115 #ifndef PY_SSIZE_T_CLEAN
116 #define PY_SSIZE_T_CLEAN
120 #error Python headers needed to compile C extensions, please install development version of Python.
121 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
122 #error Cython requires Python 2.6+ or Python 3.3+.
124 #define CYTHON_ABI "0_29_36"
125 #define CYTHON_HEX_VERSION 0x001D24F0
126 #define CYTHON_FUTURE_DIVISION 1
129 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
131 #if !defined(WIN32) && !defined(MS_WINDOWS)
143 #define DL_IMPORT(t) t
146 #define DL_EXPORT(t) t
148 #define __PYX_COMMA ,
149 #ifndef HAVE_LONG_LONG
150 #if PY_VERSION_HEX >= 0x02070000
151 #define HAVE_LONG_LONG
155 #define PY_LONG_LONG LONG_LONG
158 #define Py_HUGE_VAL HUGE_VAL
161 #define CYTHON_COMPILING_IN_PYPY 1
162 #define CYTHON_COMPILING_IN_PYSTON 0
163 #define CYTHON_COMPILING_IN_CPYTHON 0
164 #define CYTHON_COMPILING_IN_NOGIL 0
165 #undef CYTHON_USE_TYPE_SLOTS
166 #define CYTHON_USE_TYPE_SLOTS 0
167 #undef CYTHON_USE_PYTYPE_LOOKUP
168 #define CYTHON_USE_PYTYPE_LOOKUP 0
169 #if PY_VERSION_HEX < 0x03050000
170 #undef CYTHON_USE_ASYNC_SLOTS
171 #define CYTHON_USE_ASYNC_SLOTS 0
172 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
173 #define CYTHON_USE_ASYNC_SLOTS 1
175 #undef CYTHON_USE_PYLIST_INTERNALS
176 #define CYTHON_USE_PYLIST_INTERNALS 0
177 #undef CYTHON_USE_UNICODE_INTERNALS
178 #define CYTHON_USE_UNICODE_INTERNALS 0
179 #undef CYTHON_USE_UNICODE_WRITER
180 #define CYTHON_USE_UNICODE_WRITER 0
181 #undef CYTHON_USE_PYLONG_INTERNALS
182 #define CYTHON_USE_PYLONG_INTERNALS 0
183 #undef CYTHON_AVOID_BORROWED_REFS
184 #define CYTHON_AVOID_BORROWED_REFS 1
185 #undef CYTHON_ASSUME_SAFE_MACROS
186 #define CYTHON_ASSUME_SAFE_MACROS 0
187 #undef CYTHON_UNPACK_METHODS
188 #define CYTHON_UNPACK_METHODS 0
189 #undef CYTHON_FAST_THREAD_STATE
190 #define CYTHON_FAST_THREAD_STATE 0
191 #undef CYTHON_FAST_PYCALL
192 #define CYTHON_FAST_PYCALL 0
193 #if PY_VERSION_HEX < 0x03090000
194 #undef CYTHON_PEP489_MULTI_PHASE_INIT
195 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
196 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
197 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
199 #undef CYTHON_USE_TP_FINALIZE
200 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
201 #undef CYTHON_USE_DICT_VERSIONS
202 #define CYTHON_USE_DICT_VERSIONS 0
203 #undef CYTHON_USE_EXC_INFO_STACK
204 #define CYTHON_USE_EXC_INFO_STACK 0
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
208 #elif defined(PYSTON_VERSION)
209 #define CYTHON_COMPILING_IN_PYPY 0
210 #define CYTHON_COMPILING_IN_PYSTON 1
211 #define CYTHON_COMPILING_IN_CPYTHON 0
212 #define CYTHON_COMPILING_IN_NOGIL 0
213 #ifndef CYTHON_USE_TYPE_SLOTS
214 #define CYTHON_USE_TYPE_SLOTS 1
216 #undef CYTHON_USE_PYTYPE_LOOKUP
217 #define CYTHON_USE_PYTYPE_LOOKUP 0
218 #undef CYTHON_USE_ASYNC_SLOTS
219 #define CYTHON_USE_ASYNC_SLOTS 0
220 #undef CYTHON_USE_PYLIST_INTERNALS
221 #define CYTHON_USE_PYLIST_INTERNALS 0
222 #ifndef CYTHON_USE_UNICODE_INTERNALS
223 #define CYTHON_USE_UNICODE_INTERNALS 1
225 #undef CYTHON_USE_UNICODE_WRITER
226 #define CYTHON_USE_UNICODE_WRITER 0
227 #undef CYTHON_USE_PYLONG_INTERNALS
228 #define CYTHON_USE_PYLONG_INTERNALS 0
229 #ifndef CYTHON_AVOID_BORROWED_REFS
230 #define CYTHON_AVOID_BORROWED_REFS 0
232 #ifndef CYTHON_ASSUME_SAFE_MACROS
233 #define CYTHON_ASSUME_SAFE_MACROS 1
235 #ifndef CYTHON_UNPACK_METHODS
236 #define CYTHON_UNPACK_METHODS 1
238 #undef CYTHON_FAST_THREAD_STATE
239 #define CYTHON_FAST_THREAD_STATE 0
240 #undef CYTHON_FAST_PYCALL
241 #define CYTHON_FAST_PYCALL 0
242 #undef CYTHON_PEP489_MULTI_PHASE_INIT
243 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
244 #undef CYTHON_USE_TP_FINALIZE
245 #define CYTHON_USE_TP_FINALIZE 0
246 #undef CYTHON_USE_DICT_VERSIONS
247 #define CYTHON_USE_DICT_VERSIONS 0
248 #undef CYTHON_USE_EXC_INFO_STACK
249 #define CYTHON_USE_EXC_INFO_STACK 0
250 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
253 #elif defined(PY_NOGIL)
254 #define CYTHON_COMPILING_IN_PYPY 0
255 #define CYTHON_COMPILING_IN_PYSTON 0
256 #define CYTHON_COMPILING_IN_CPYTHON 0
257 #define CYTHON_COMPILING_IN_NOGIL 1
258 #ifndef CYTHON_USE_TYPE_SLOTS
259 #define CYTHON_USE_TYPE_SLOTS 1
261 #undef CYTHON_USE_PYTYPE_LOOKUP
262 #define CYTHON_USE_PYTYPE_LOOKUP 0
263 #ifndef CYTHON_USE_ASYNC_SLOTS
264 #define CYTHON_USE_ASYNC_SLOTS 1
266 #undef CYTHON_USE_PYLIST_INTERNALS
267 #define CYTHON_USE_PYLIST_INTERNALS 0
268 #ifndef CYTHON_USE_UNICODE_INTERNALS
269 #define CYTHON_USE_UNICODE_INTERNALS 1
271 #undef CYTHON_USE_UNICODE_WRITER
272 #define CYTHON_USE_UNICODE_WRITER 0
273 #undef CYTHON_USE_PYLONG_INTERNALS
274 #define CYTHON_USE_PYLONG_INTERNALS 0
275 #ifndef CYTHON_AVOID_BORROWED_REFS
276 #define CYTHON_AVOID_BORROWED_REFS 0
278 #ifndef CYTHON_ASSUME_SAFE_MACROS
279 #define CYTHON_ASSUME_SAFE_MACROS 1
281 #ifndef CYTHON_UNPACK_METHODS
282 #define CYTHON_UNPACK_METHODS 1
284 #undef CYTHON_FAST_THREAD_STATE
285 #define CYTHON_FAST_THREAD_STATE 0
286 #undef CYTHON_FAST_PYCALL
287 #define CYTHON_FAST_PYCALL 0
288 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
289 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
291 #ifndef CYTHON_USE_TP_FINALIZE
292 #define CYTHON_USE_TP_FINALIZE 1
294 #undef CYTHON_USE_DICT_VERSIONS
295 #define CYTHON_USE_DICT_VERSIONS 0
296 #undef CYTHON_USE_EXC_INFO_STACK
297 #define CYTHON_USE_EXC_INFO_STACK 0
299 #define CYTHON_COMPILING_IN_PYPY 0
300 #define CYTHON_COMPILING_IN_PYSTON 0
301 #define CYTHON_COMPILING_IN_CPYTHON 1
302 #define CYTHON_COMPILING_IN_NOGIL 0
303 #ifndef CYTHON_USE_TYPE_SLOTS
304 #define CYTHON_USE_TYPE_SLOTS 1
306 #if PY_VERSION_HEX < 0x02070000
307 #undef CYTHON_USE_PYTYPE_LOOKUP
308 #define CYTHON_USE_PYTYPE_LOOKUP 0
309 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
310 #define CYTHON_USE_PYTYPE_LOOKUP 1
312 #if PY_MAJOR_VERSION < 3
313 #undef CYTHON_USE_ASYNC_SLOTS
314 #define CYTHON_USE_ASYNC_SLOTS 0
315 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
316 #define CYTHON_USE_ASYNC_SLOTS 1
318 #if PY_VERSION_HEX < 0x02070000
319 #undef CYTHON_USE_PYLONG_INTERNALS
320 #define CYTHON_USE_PYLONG_INTERNALS 0
321 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
322 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
324 #ifndef CYTHON_USE_PYLIST_INTERNALS
325 #define CYTHON_USE_PYLIST_INTERNALS 1
327 #ifndef CYTHON_USE_UNICODE_INTERNALS
328 #define CYTHON_USE_UNICODE_INTERNALS 1
330 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
331 #undef CYTHON_USE_UNICODE_WRITER
332 #define CYTHON_USE_UNICODE_WRITER 0
333 #elif !defined(CYTHON_USE_UNICODE_WRITER)
334 #define CYTHON_USE_UNICODE_WRITER 1
336 #ifndef CYTHON_AVOID_BORROWED_REFS
337 #define CYTHON_AVOID_BORROWED_REFS 0
339 #ifndef CYTHON_ASSUME_SAFE_MACROS
340 #define CYTHON_ASSUME_SAFE_MACROS 1
342 #ifndef CYTHON_UNPACK_METHODS
343 #define CYTHON_UNPACK_METHODS 1
345 #if PY_VERSION_HEX >= 0x030B00A4
346 #undef CYTHON_FAST_THREAD_STATE
347 #define CYTHON_FAST_THREAD_STATE 0
348 #elif !defined(CYTHON_FAST_THREAD_STATE)
349 #define CYTHON_FAST_THREAD_STATE 1
351 #ifndef CYTHON_FAST_PYCALL
352 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
354 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
355 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
357 #ifndef CYTHON_USE_TP_FINALIZE
358 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
360 #ifndef CYTHON_USE_DICT_VERSIONS
361 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
363 #if PY_VERSION_HEX >= 0x030B00A4
364 #undef CYTHON_USE_EXC_INFO_STACK
365 #define CYTHON_USE_EXC_INFO_STACK 0
366 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
367 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
369 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
370 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
373 #if !defined(CYTHON_FAST_PYCCALL)
374 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
376 #if CYTHON_USE_PYLONG_INTERNALS
377 #if PY_MAJOR_VERSION < 3
378 #include "longintrepr.h"
384 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
387 #ifndef __has_attribute
388 #define __has_attribute(x) 0
390 #ifndef __has_cpp_attribute
391 #define __has_cpp_attribute(x) 0
393 #ifndef CYTHON_RESTRICT
394 #if defined(__GNUC__)
395 #define CYTHON_RESTRICT __restrict__
396 #elif defined(_MSC_VER) && _MSC_VER >= 1400
397 #define CYTHON_RESTRICT __restrict
398 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
399 #define CYTHON_RESTRICT restrict
401 #define CYTHON_RESTRICT
404 #ifndef CYTHON_UNUSED
405 # if defined(__GNUC__)
406 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
407 # define CYTHON_UNUSED __attribute__ ((__unused__))
409 # define CYTHON_UNUSED
411 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
412 # define CYTHON_UNUSED __attribute__ ((__unused__))
414 # define CYTHON_UNUSED
417 #ifndef CYTHON_MAYBE_UNUSED_VAR
418 # if defined(__cplusplus)
419 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
421 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
424 #ifndef CYTHON_NCP_UNUSED
425 # if CYTHON_COMPILING_IN_CPYTHON
426 # define CYTHON_NCP_UNUSED
428 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
431 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
433 #ifndef _MSC_STDINT_H_
435 typedef unsigned char uint8_t;
436 typedef unsigned int uint32_t;
438 typedef unsigned __int8 uint8_t;
439 typedef unsigned __int32 uint32_t;
445 #ifndef CYTHON_FALLTHROUGH
446 #if defined(__cplusplus) && __cplusplus >= 201103L
447 #if __has_cpp_attribute(fallthrough)
448 #define CYTHON_FALLTHROUGH [[fallthrough]]
449 #elif __has_cpp_attribute(clang::fallthrough)
450 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
451 #elif __has_cpp_attribute(gnu::fallthrough)
452 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
455 #ifndef CYTHON_FALLTHROUGH
456 #if __has_attribute(fallthrough)
457 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
459 #define CYTHON_FALLTHROUGH
462 #if defined(__clang__ ) && defined(__apple_build_version__)
463 #if __apple_build_version__ < 7000000
464 #undef CYTHON_FALLTHROUGH
465 #define CYTHON_FALLTHROUGH
471 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
473 #ifndef CYTHON_INLINE
474 #if defined(__clang__)
475 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
477 #define CYTHON_INLINE inline
481 void __Pyx_call_destructor(T& x) {
485 class __Pyx_FakeReference {
487 __Pyx_FakeReference() : ptr(NULL) { }
488 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
489 T *operator->() {
return ptr; }
490 T *operator&() {
return ptr; }
491 operator T&() {
return *ptr; }
492 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
493 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
498 #define __PYX_BUILD_PY_SSIZE_T "n"
499 #define CYTHON_FORMAT_SSIZE_T "z"
500 #if PY_MAJOR_VERSION < 3
501 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
502 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
503 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
504 #define __Pyx_DefaultClassType PyClass_Type
506 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
507 #define __Pyx_DefaultClassType PyType_Type
508 #if PY_VERSION_HEX >= 0x030B00A1
509 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
510 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
511 PyObject *fv, PyObject *cell, PyObject* fn,
512 PyObject *name,
int fline, PyObject *lnos) {
513 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
514 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
515 const char *fn_cstr=NULL;
516 const char *name_cstr=NULL;
517 PyCodeObject* co=NULL;
518 PyObject *type, *value, *traceback;
519 PyErr_Fetch(&type, &value, &traceback);
520 if (!(kwds=PyDict_New()))
goto end;
521 if (!(argcount=PyLong_FromLong(a)))
goto end;
522 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
523 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
524 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
525 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
526 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
527 if (!(nlocals=PyLong_FromLong(l)))
goto end;
528 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
529 if (!(stacksize=PyLong_FromLong(s)))
goto end;
530 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
531 if (!(flags=PyLong_FromLong(f)))
goto end;
532 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
533 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
534 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
535 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
536 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
537 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
538 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
539 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
540 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
541 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
542 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
543 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
544 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
545 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
546 Py_XDECREF((PyObject*)co);
547 co = (PyCodeObject*)call_result;
551 Py_XDECREF((PyObject*)co);
556 Py_XDECREF(argcount);
557 Py_XDECREF(posonlyargcount);
558 Py_XDECREF(kwonlyargcount);
560 Py_XDECREF(stacksize);
562 Py_XDECREF(call_result);
565 PyErr_Restore(type, value, traceback);
570 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
571 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
573 #define __Pyx_DefaultClassType PyType_Type
575 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
576 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
578 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
580 #ifndef Py_TPFLAGS_CHECKTYPES
581 #define Py_TPFLAGS_CHECKTYPES 0
583 #ifndef Py_TPFLAGS_HAVE_INDEX
584 #define Py_TPFLAGS_HAVE_INDEX 0
586 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
587 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
589 #ifndef Py_TPFLAGS_HAVE_FINALIZE
590 #define Py_TPFLAGS_HAVE_FINALIZE 0
592 #ifndef METH_STACKLESS
593 #define METH_STACKLESS 0
595 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
596 #ifndef METH_FASTCALL
597 #define METH_FASTCALL 0x80
599 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
600 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
601 Py_ssize_t nargs, PyObject *kwnames);
603 #define __Pyx_PyCFunctionFast _PyCFunctionFast
604 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
606 #if CYTHON_FAST_PYCCALL
607 #define __Pyx_PyFastCFunction_Check(func)\
608 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
610 #define __Pyx_PyFastCFunction_Check(func) 0
612 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
613 #define PyObject_Malloc(s) PyMem_Malloc(s)
614 #define PyObject_Free(p) PyMem_Free(p)
615 #define PyObject_Realloc(p) PyMem_Realloc(p)
617 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
618 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
619 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
620 #define PyMem_RawFree(p) PyMem_Free(p)
622 #if CYTHON_COMPILING_IN_PYSTON
623 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
624 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
626 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
627 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
629 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
630 #define __Pyx_PyThreadState_Current PyThreadState_GET()
631 #elif PY_VERSION_HEX >= 0x03060000
632 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
633 #elif PY_VERSION_HEX >= 0x03000000
634 #define __Pyx_PyThreadState_Current PyThreadState_GET()
636 #define __Pyx_PyThreadState_Current _PyThreadState_Current
638 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
639 #include "pythread.h"
640 #define Py_tss_NEEDS_INIT 0
641 typedef int Py_tss_t;
642 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
643 *key = PyThread_create_key();
646 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
647 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
648 *key = Py_tss_NEEDS_INIT;
651 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
654 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
655 return *key != Py_tss_NEEDS_INIT;
657 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
658 PyThread_delete_key(*key);
659 *key = Py_tss_NEEDS_INIT;
661 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
662 return PyThread_set_key_value(*key, value);
664 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
665 return PyThread_get_key_value(*key);
668 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
669 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
671 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
673 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
674 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
675 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
677 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
678 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
680 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
681 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
683 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
685 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
686 #define CYTHON_PEP393_ENABLED 1
687 #if PY_VERSION_HEX >= 0x030C0000
688 #define __Pyx_PyUnicode_READY(op) (0)
690 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
691 0 : _PyUnicode_Ready((PyObject *)(op)))
693 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
694 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
695 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
696 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
697 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
698 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
699 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
700 #if PY_VERSION_HEX >= 0x030C0000
701 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
703 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
704 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
706 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
710 #define CYTHON_PEP393_ENABLED 0
711 #define PyUnicode_1BYTE_KIND 1
712 #define PyUnicode_2BYTE_KIND 2
713 #define PyUnicode_4BYTE_KIND 4
714 #define __Pyx_PyUnicode_READY(op) (0)
715 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
716 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
717 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
718 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
719 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
720 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
721 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
722 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
724 #if CYTHON_COMPILING_IN_PYPY
725 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
726 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
728 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
729 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
730 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
732 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
733 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
735 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
736 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
738 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
739 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
741 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
742 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
743 #if PY_MAJOR_VERSION >= 3
744 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
746 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
748 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
749 #define PyObject_ASCII(o) PyObject_Repr(o)
751 #if PY_MAJOR_VERSION >= 3
752 #define PyBaseString_Type PyUnicode_Type
753 #define PyStringObject PyUnicodeObject
754 #define PyString_Type PyUnicode_Type
755 #define PyString_Check PyUnicode_Check
756 #define PyString_CheckExact PyUnicode_CheckExact
757 #ifndef PyObject_Unicode
758 #define PyObject_Unicode PyObject_Str
761 #if PY_MAJOR_VERSION >= 3
762 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
763 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
765 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
766 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
768 #ifndef PySet_CheckExact
769 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
771 #if PY_VERSION_HEX >= 0x030900A4
772 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
773 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
775 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
776 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
778 #if CYTHON_ASSUME_SAFE_MACROS
779 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
781 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
783 #if PY_MAJOR_VERSION >= 3
784 #define PyIntObject PyLongObject
785 #define PyInt_Type PyLong_Type
786 #define PyInt_Check(op) PyLong_Check(op)
787 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
788 #define PyInt_FromString PyLong_FromString
789 #define PyInt_FromUnicode PyLong_FromUnicode
790 #define PyInt_FromLong PyLong_FromLong
791 #define PyInt_FromSize_t PyLong_FromSize_t
792 #define PyInt_FromSsize_t PyLong_FromSsize_t
793 #define PyInt_AsLong PyLong_AsLong
794 #define PyInt_AS_LONG PyLong_AS_LONG
795 #define PyInt_AsSsize_t PyLong_AsSsize_t
796 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
797 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
798 #define PyNumber_Int PyNumber_Long
800 #if PY_MAJOR_VERSION >= 3
801 #define PyBoolObject PyLongObject
803 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
804 #ifndef PyUnicode_InternFromString
805 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
808 #if PY_VERSION_HEX < 0x030200A4
809 typedef long Py_hash_t;
810 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
811 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
813 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
814 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
816 #if PY_MAJOR_VERSION >= 3
817 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
819 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
821 #if CYTHON_USE_ASYNC_SLOTS
822 #if PY_VERSION_HEX >= 0x030500B1
823 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
824 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
826 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
829 #define __Pyx_PyType_AsAsync(obj) NULL
831 #ifndef __Pyx_PyAsyncMethodsStruct
836 } __Pyx_PyAsyncMethodsStruct;
839 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
840 #if !defined(_USE_MATH_DEFINES)
841 #define _USE_MATH_DEFINES
846 #define __PYX_NAN() ((float) NAN)
848 static CYTHON_INLINE
float __PYX_NAN() {
850 memset(&value, 0xFF,
sizeof(value));
854 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
855 #define __Pyx_truncl trunc
857 #define __Pyx_truncl truncl
860 #define __PYX_MARK_ERR_POS(f_index, lineno) \
861 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
862 #define __PYX_ERR(f_index, lineno, Ln_error) \
863 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
865 #ifndef __PYX_EXTERN_C
867 #define __PYX_EXTERN_C extern "C"
869 #define __PYX_EXTERN_C extern
873 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
874 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
886 #include "pythread.h"
895 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
896 #define CYTHON_WITHOUT_ASSERTIONS
899 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
900 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
902 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
903 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
904 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
905 #define __PYX_DEFAULT_STRING_ENCODING ""
906 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
907 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
908 #define __Pyx_uchar_cast(c) ((unsigned char)c)
909 #define __Pyx_long_cast(x) ((long)x)
910 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
911 (sizeof(type) < sizeof(Py_ssize_t)) ||\
912 (sizeof(type) > sizeof(Py_ssize_t) &&\
913 likely(v < (type)PY_SSIZE_T_MAX ||\
914 v == (type)PY_SSIZE_T_MAX) &&\
915 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
916 v == (type)PY_SSIZE_T_MIN))) ||\
917 (sizeof(type) == sizeof(Py_ssize_t) &&\
918 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
919 v == (type)PY_SSIZE_T_MAX))) )
920 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
921 return (
size_t) i < (size_t) limit;
923 #if defined (__cplusplus) && __cplusplus >= 201103L
925 #define __Pyx_sst_abs(value) std::abs(value)
926 #elif SIZEOF_INT >= SIZEOF_SIZE_T
927 #define __Pyx_sst_abs(value) abs(value)
928 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
929 #define __Pyx_sst_abs(value) labs(value)
930 #elif defined (_MSC_VER)
931 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
932 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
933 #define __Pyx_sst_abs(value) llabs(value)
934 #elif defined (__GNUC__)
935 #define __Pyx_sst_abs(value) __builtin_llabs(value)
937 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
939 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
940 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
941 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
942 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
943 #define __Pyx_PyBytes_FromString PyBytes_FromString
944 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
945 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
946 #if PY_MAJOR_VERSION < 3
947 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
948 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
950 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
951 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
953 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
954 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
955 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
956 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
957 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
958 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
959 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
960 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
961 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
962 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
963 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
964 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
965 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
966 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
967 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
968 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
969 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
970 const Py_UNICODE *u_end = u;
972 return (
size_t)(u_end - u - 1);
974 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
975 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
976 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
977 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
978 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
979 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
980 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
981 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
982 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
983 #define __Pyx_PySequence_Tuple(obj)\
984 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
985 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
986 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
987 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
988 #if CYTHON_ASSUME_SAFE_MACROS
989 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
991 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
993 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
994 #if PY_MAJOR_VERSION >= 3
995 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
997 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
999 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1000 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1001 static int __Pyx_sys_getdefaultencoding_not_ascii;
1002 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1004 PyObject* default_encoding = NULL;
1005 PyObject* ascii_chars_u = NULL;
1006 PyObject* ascii_chars_b = NULL;
1007 const char* default_encoding_c;
1008 sys = PyImport_ImportModule(
"sys");
1010 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1012 if (!default_encoding)
goto bad;
1013 default_encoding_c = PyBytes_AsString(default_encoding);
1014 if (!default_encoding_c)
goto bad;
1015 if (strcmp(default_encoding_c,
"ascii") == 0) {
1016 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1018 char ascii_chars[128];
1020 for (c = 0; c < 128; c++) {
1023 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1024 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1025 if (!ascii_chars_u)
goto bad;
1026 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1027 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1030 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1031 default_encoding_c);
1034 Py_DECREF(ascii_chars_u);
1035 Py_DECREF(ascii_chars_b);
1037 Py_DECREF(default_encoding);
1040 Py_XDECREF(default_encoding);
1041 Py_XDECREF(ascii_chars_u);
1042 Py_XDECREF(ascii_chars_b);
1046 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1047 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1049 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1050 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1051 static char* __PYX_DEFAULT_STRING_ENCODING;
1052 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1054 PyObject* default_encoding = NULL;
1055 char* default_encoding_c;
1056 sys = PyImport_ImportModule(
"sys");
1058 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1060 if (!default_encoding)
goto bad;
1061 default_encoding_c = PyBytes_AsString(default_encoding);
1062 if (!default_encoding_c)
goto bad;
1063 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1064 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1065 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1066 Py_DECREF(default_encoding);
1069 Py_XDECREF(default_encoding);
1077 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1078 #define likely(x) __builtin_expect(!!(x), 1)
1079 #define unlikely(x) __builtin_expect(!!(x), 0)
1081 #define likely(x) (x)
1082 #define unlikely(x) (x)
1084 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1086 static PyObject *__pyx_m = NULL;
1087 static PyObject *__pyx_d;
1088 static PyObject *__pyx_b;
1089 static PyObject *__pyx_cython_runtime = NULL;
1090 static PyObject *__pyx_empty_tuple;
1091 static PyObject *__pyx_empty_bytes;
1092 static PyObject *__pyx_empty_unicode;
1093 static int __pyx_lineno;
1094 static int __pyx_clineno = 0;
1095 static const char * __pyx_cfilenm= __FILE__;
1096 static const char *__pyx_filename;
1099 static const char *__pyx_f[] = {
1100 "imate/_c_linear_operator/py_c_matrix.pyx",
1104 struct __pyx_memoryview_obj;
1106 struct __pyx_memoryview_obj *memview;
1108 Py_ssize_t shape[8];
1109 Py_ssize_t strides[8];
1110 Py_ssize_t suboffsets[8];
1111 } __Pyx_memviewslice;
1112 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1115 #include <pythread.h>
1116 #ifndef CYTHON_ATOMICS
1117 #define CYTHON_ATOMICS 1
1119 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1120 #define __pyx_atomic_int_type int
1121 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1122 (__GNUC_MINOR__ > 1 ||\
1123 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1124 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1125 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1126 #ifdef __PYX_DEBUG_ATOMICS
1127 #warning "Using GNU atomics"
1129 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1131 #undef __pyx_atomic_int_type
1132 #define __pyx_atomic_int_type long
1133 #pragma intrinsic (_InterlockedExchangeAdd)
1134 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1135 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1136 #ifdef __PYX_DEBUG_ATOMICS
1137 #pragma message ("Using MSVC atomics")
1140 #undef CYTHON_ATOMICS
1141 #define CYTHON_ATOMICS 0
1142 #ifdef __PYX_DEBUG_ATOMICS
1143 #warning "Not using atomics"
1146 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1148 #define __pyx_add_acquisition_count(memview)\
1149 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1150 #define __pyx_sub_acquisition_count(memview)\
1151 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1153 #define __pyx_add_acquisition_count(memview)\
1154 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1155 #define __pyx_sub_acquisition_count(memview)\
1156 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1160 #ifndef __PYX_FORCE_INIT_THREADS
1161 #define __PYX_FORCE_INIT_THREADS 0
1165 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1166 #define __Pyx_PyGILState_Release PyGILState_Release
1167 #define __Pyx_FastGIL_Remember()
1168 #define __Pyx_FastGIL_Forget()
1169 #define __Pyx_FastGilFuncInit()
1172 #define IS_UNSIGNED(type) (((type) -1) > 0)
1173 struct __Pyx_StructField_;
1174 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1177 struct __Pyx_StructField_* fields;
1179 size_t arraysize[8];
1185 typedef struct __Pyx_StructField_ {
1186 __Pyx_TypeInfo* type;
1189 } __Pyx_StructField;
1191 __Pyx_StructField* field;
1192 size_t parent_offset;
1193 } __Pyx_BufFmt_StackElem;
1195 __Pyx_StructField root;
1196 __Pyx_BufFmt_StackElem* head;
1198 size_t new_count, enc_count;
1199 size_t struct_alignment;
1204 char is_valid_array;
1205 } __Pyx_BufFmt_Context;
1215 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1224 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1227 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1228 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1241 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1250 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1259 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1268 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1277 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1279 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1283 char *data_type_name;
1284 char *long_index_type_name;
1285 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1286 PyObject *parameters;
1297 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1298 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1300 PyObject *A_indices_copy;
1301 PyObject *A_index_pointer_copy;
1312 struct __pyx_array_obj {
1314 struct __pyx_vtabstruct_array *__pyx_vtab;
1320 Py_ssize_t *_strides;
1321 Py_ssize_t itemsize;
1324 void (*callback_free_data)(
void *);
1326 int dtype_is_object;
1337 struct __pyx_MemviewEnum_obj {
1350 struct __pyx_memoryview_obj {
1352 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1355 PyObject *_array_interface;
1356 PyThread_type_lock lock;
1357 __pyx_atomic_int acquisition_count[2];
1358 __pyx_atomic_int *acquisition_count_aligned_p;
1361 int dtype_is_object;
1362 __Pyx_TypeInfo *typeinfo;
1373 struct __pyx_memoryviewslice_obj {
1374 struct __pyx_memoryview_obj __pyx_base;
1375 __Pyx_memviewslice from_slice;
1376 PyObject *from_object;
1377 PyObject *(*to_object_func)(
char *);
1378 int (*to_dtype_func)(
char *, PyObject *);
1391 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1392 LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1393 LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1394 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1395 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1396 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1397 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1398 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1400 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1411 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1412 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1414 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1425 struct __pyx_vtabstruct_array {
1426 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1428 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1439 struct __pyx_vtabstruct_memoryview {
1440 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1441 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1442 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1443 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1444 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1445 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1446 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1448 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1459 struct __pyx_vtabstruct__memoryviewslice {
1460 struct __pyx_vtabstruct_memoryview __pyx_base;
1462 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1466 #ifndef CYTHON_REFNANNY
1467 #define CYTHON_REFNANNY 0
1471 void (*INCREF)(
void*, PyObject*, int);
1472 void (*DECREF)(
void*, PyObject*, int);
1473 void (*GOTREF)(
void*, PyObject*, int);
1474 void (*GIVEREF)(
void*, PyObject*, int);
1475 void* (*SetupContext)(
const char*, int,
const char*);
1476 void (*FinishContext)(
void**);
1477 } __Pyx_RefNannyAPIStruct;
1478 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1479 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1480 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1482 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1484 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1485 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1486 PyGILState_Release(__pyx_gilstate_save);\
1488 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1491 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1492 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1494 #define __Pyx_RefNannyFinishContext()\
1495 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1496 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1497 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1498 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1499 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1500 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1501 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1502 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1503 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1505 #define __Pyx_RefNannyDeclarations
1506 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1507 #define __Pyx_RefNannyFinishContext()
1508 #define __Pyx_INCREF(r) Py_INCREF(r)
1509 #define __Pyx_DECREF(r) Py_DECREF(r)
1510 #define __Pyx_GOTREF(r)
1511 #define __Pyx_GIVEREF(r)
1512 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1513 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1514 #define __Pyx_XGOTREF(r)
1515 #define __Pyx_XGIVEREF(r)
1517 #define __Pyx_XDECREF_SET(r, v) do {\
1518 PyObject *tmp = (PyObject *) r;\
1519 r = v; __Pyx_XDECREF(tmp);\
1521 #define __Pyx_DECREF_SET(r, v) do {\
1522 PyObject *tmp = (PyObject *) r;\
1523 r = v; __Pyx_DECREF(tmp);\
1525 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1526 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1529 #if CYTHON_USE_TYPE_SLOTS
1530 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1532 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1536 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1539 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1542 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1543 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1544 const char* function_name);
1547 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1548 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1551 #if CYTHON_FAST_THREAD_STATE
1552 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1553 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1554 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1556 #define __Pyx_PyThreadState_declare
1557 #define __Pyx_PyThreadState_assign
1558 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1562 #if CYTHON_FAST_THREAD_STATE
1563 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1564 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1565 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1566 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1567 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1568 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1569 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1570 #if CYTHON_COMPILING_IN_CPYTHON
1571 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1573 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1576 #define __Pyx_PyErr_Clear() PyErr_Clear()
1577 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1578 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1579 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1580 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1581 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1582 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1583 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1587 #ifndef CYTHON_PROFILE
1588 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1589 #define CYTHON_PROFILE 0
1591 #define CYTHON_PROFILE 1
1594 #ifndef CYTHON_TRACE_NOGIL
1595 #define CYTHON_TRACE_NOGIL 0
1597 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1598 #define CYTHON_TRACE 1
1601 #ifndef CYTHON_TRACE
1602 #define CYTHON_TRACE 0
1605 #undef CYTHON_PROFILE_REUSE_FRAME
1607 #ifndef CYTHON_PROFILE_REUSE_FRAME
1608 #define CYTHON_PROFILE_REUSE_FRAME 0
1610 #if CYTHON_PROFILE || CYTHON_TRACE
1611 #include "compile.h"
1612 #include "frameobject.h"
1613 #include "traceback.h"
1614 #if PY_VERSION_HEX >= 0x030b00a6
1615 #ifndef Py_BUILD_CORE
1616 #define Py_BUILD_CORE 1
1618 #include "internal/pycore_frame.h"
1620 #if CYTHON_PROFILE_REUSE_FRAME
1621 #define CYTHON_FRAME_MODIFIER static
1622 #define CYTHON_FRAME_DEL(frame)
1624 #define CYTHON_FRAME_MODIFIER
1625 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1627 #define __Pyx_TraceDeclarations\
1628 static PyCodeObject *__pyx_frame_code = NULL;\
1629 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1630 int __Pyx_use_tracing = 0;
1631 #define __Pyx_TraceFrameInit(codeobj)\
1632 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1633 #if PY_VERSION_HEX >= 0x030b00a2
1634 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1635 (unlikely((tstate)->cframe->use_tracing) &&\
1636 (!(check_tracing) || !(tstate)->tracing) &&\
1637 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1638 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1639 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1640 #elif PY_VERSION_HEX >= 0x030a00b1
1641 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1642 (unlikely((tstate)->cframe->use_tracing) &&\
1643 (!(check_tracing) || !(tstate)->tracing) &&\
1644 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1645 #define __Pyx_EnterTracing(tstate)\
1646 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1647 #define __Pyx_LeaveTracing(tstate)\
1650 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1651 || tstate->c_profilefunc != NULL);\
1654 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1655 (unlikely((tstate)->use_tracing) &&\
1656 (!(check_tracing) || !(tstate)->tracing) &&\
1657 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1658 #define __Pyx_EnterTracing(tstate)\
1659 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1660 #define __Pyx_LeaveTracing(tstate)\
1663 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1664 || tstate->c_profilefunc != NULL);\
1668 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1670 if (CYTHON_TRACE_NOGIL) {\
1671 PyThreadState *tstate;\
1672 PyGILState_STATE state = PyGILState_Ensure();\
1673 tstate = __Pyx_PyThreadState_Current;\
1674 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1675 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1677 PyGILState_Release(state);\
1678 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1681 PyThreadState* tstate = PyThreadState_GET();\
1682 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1683 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1684 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1688 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1689 { PyThreadState* tstate = PyThreadState_GET();\
1690 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1691 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1692 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1696 #define __Pyx_TraceException()\
1697 if (likely(!__Pyx_use_tracing)); else {\
1698 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1699 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1700 __Pyx_EnterTracing(tstate);\
1701 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1703 if (CYTHON_TRACE && tstate->c_tracefunc)\
1704 tstate->c_tracefunc(\
1705 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1706 tstate->c_profilefunc(\
1707 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1708 Py_DECREF(exc_info);\
1710 __Pyx_LeaveTracing(tstate);\
1713 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1714 PyObject *type, *value, *traceback;
1715 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1716 __Pyx_EnterTracing(tstate);
1717 if (CYTHON_TRACE && tstate->c_tracefunc)
1718 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1719 if (tstate->c_profilefunc)
1720 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1721 CYTHON_FRAME_DEL(frame);
1722 __Pyx_LeaveTracing(tstate);
1723 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1726 #define __Pyx_TraceReturn(result, nogil)\
1727 if (likely(!__Pyx_use_tracing)); else {\
1729 if (CYTHON_TRACE_NOGIL) {\
1730 PyThreadState *tstate;\
1731 PyGILState_STATE state = PyGILState_Ensure();\
1732 tstate = __Pyx_PyThreadState_Current;\
1733 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1734 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1736 PyGILState_Release(state);\
1739 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1740 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1741 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1746 #define __Pyx_TraceReturn(result, nogil)\
1747 if (likely(!__Pyx_use_tracing)); else {\
1748 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1749 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1750 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1754 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1755 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1757 #define __Pyx_TraceDeclarations
1758 #define __Pyx_TraceFrameInit(codeobj)
1759 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1760 #define __Pyx_TraceException()
1761 #define __Pyx_TraceReturn(result, nogil)
1764 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1766 PyObject *type, *value, *traceback;
1767 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1768 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1769 __Pyx_EnterTracing(tstate);
1770 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1771 __Pyx_LeaveTracing(tstate);
1773 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1777 Py_XDECREF(traceback);
1782 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1783 if (likely(!__Pyx_use_tracing)); else {\
1785 if (CYTHON_TRACE_NOGIL) {\
1787 PyThreadState *tstate;\
1788 PyGILState_STATE state = PyGILState_Ensure();\
1789 tstate = __Pyx_PyThreadState_Current;\
1790 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1791 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1793 PyGILState_Release(state);\
1794 if (unlikely(ret)) goto_error;\
1797 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1798 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1799 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1800 if (unlikely(ret)) goto_error;\
1805 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1806 if (likely(!__Pyx_use_tracing)); else {\
1807 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1808 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1809 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1810 if (unlikely(ret)) goto_error;\
1815 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1819 #if CYTHON_COMPILING_IN_CPYTHON
1820 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1822 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1826 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1829 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1835 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1838 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1839 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1840 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1841 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1842 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1843 (cache_var) = (value);
1844 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1845 static PY_UINT64_T __pyx_dict_version = 0;\
1846 static PyObject *__pyx_dict_cached_value = NULL;\
1847 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1848 (VAR) = __pyx_dict_cached_value;\
1850 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1851 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1854 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1855 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1856 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1858 #define __PYX_GET_DICT_VERSION(dict) (0)
1859 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1860 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1864 #if CYTHON_USE_DICT_VERSIONS
1865 #define __Pyx_GetModuleGlobalName(var, name) do {\
1866 static PY_UINT64_T __pyx_dict_version = 0;\
1867 static PyObject *__pyx_dict_cached_value = NULL;\
1868 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1869 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1870 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1872 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1873 PY_UINT64_T __pyx_dict_version;\
1874 PyObject *__pyx_dict_cached_value;\
1875 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1877 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1879 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1880 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1881 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1885 #if CYTHON_FAST_PYCCALL
1886 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1888 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1892 #if CYTHON_FAST_PYCALL
1893 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1894 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1895 #if 1 || PY_VERSION_HEX < 0x030600B1
1896 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1898 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1900 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1901 (sizeof(char [1 - 2*!(cond)]) - 1)
1902 #ifndef Py_MEMBER_SIZE
1903 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1905 #if CYTHON_FAST_PYCALL
1906 static size_t __pyx_pyframe_localsplus_offset = 0;
1907 #include "frameobject.h"
1908 #if PY_VERSION_HEX >= 0x030b00a6
1909 #ifndef Py_BUILD_CORE
1910 #define Py_BUILD_CORE 1
1912 #include "internal/pycore_frame.h"
1914 #define __Pxy_PyFrame_Initialize_Offsets()\
1915 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1916 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1917 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1918 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1923 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1926 #if CYTHON_COMPILING_IN_CPYTHON
1927 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1931 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1934 #if CYTHON_COMPILING_IN_CPYTHON
1935 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1937 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1941 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1942 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1943 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1944 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1945 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1946 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1947 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1948 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1949 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1950 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1951 int wraparound,
int boundscheck);
1952 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1953 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1954 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1955 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1956 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1957 int wraparound,
int boundscheck);
1958 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1960 int is_list,
int wraparound,
int boundscheck);
1963 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1964 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1965 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1966 (likely(PyDict_CheckExact(obj)) ?\
1967 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1969 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1970 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1974 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1975 #define __Pyx_MEMVIEW_DIRECT 1
1976 #define __Pyx_MEMVIEW_PTR 2
1977 #define __Pyx_MEMVIEW_FULL 4
1978 #define __Pyx_MEMVIEW_CONTIG 8
1979 #define __Pyx_MEMVIEW_STRIDED 16
1980 #define __Pyx_MEMVIEW_FOLLOW 32
1981 #define __Pyx_IS_C_CONTIG 1
1982 #define __Pyx_IS_F_CONTIG 2
1983 static int __Pyx_init_memviewslice(
1984 struct __pyx_memoryview_obj *memview,
1986 __Pyx_memviewslice *memviewslice,
1987 int memview_is_new_reference);
1988 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1989 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1990 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1991 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1992 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1993 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1994 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1995 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1996 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1997 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2000 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2001 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2002 __Pyx__ArgTypeTest(obj, type, name, exact))
2003 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2006 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2009 #if PY_MAJOR_VERSION >= 3
2010 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2012 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2016 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2017 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2019 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2021 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2022 int lineno,
const char *filename,
2023 int full_traceback,
int nogil);
2025 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2027 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2030 #if CYTHON_USE_TYPE_SLOTS
2031 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2033 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2037 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
2039 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2041 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
2043 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2045 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
2047 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2051 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2052 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2053 const char* encoding,
const char* errors,
2054 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2059 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2061 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2065 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2068 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2071 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2074 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2077 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2080 #if CYTHON_USE_EXC_INFO_STACK
2081 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2085 #if CYTHON_FAST_THREAD_STATE
2086 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2087 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2088 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2089 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2091 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2092 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2096 #if CYTHON_FAST_THREAD_STATE
2097 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2098 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2100 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2104 #if CYTHON_FAST_THREAD_STATE
2105 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2106 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2108 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2112 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2115 #if CYTHON_COMPILING_IN_CPYTHON
2116 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2117 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2118 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2119 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2121 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2122 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2123 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2125 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2127 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2129 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2130 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2131 PyListObject* L = (PyListObject*) list;
2132 Py_ssize_t len = Py_SIZE(list);
2133 if (likely(L->allocated > len)) {
2135 PyList_SET_ITEM(list, len, x);
2136 __Pyx_SET_SIZE(list, len + 1);
2139 return PyList_Append(list, x);
2142 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2146 #if !CYTHON_COMPILING_IN_PYPY
2147 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2149 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2150 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2154 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2155 #if CYTHON_COMPILING_IN_CPYTHON
2156 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2157 if (unlikely(!none))
2162 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2167 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2168 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2169 PyListObject* L = (PyListObject*) list;
2170 Py_ssize_t len = Py_SIZE(list);
2171 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2173 PyList_SET_ITEM(list, len, x);
2174 __Pyx_SET_SIZE(list, len + 1);
2177 return PyList_Append(list, x);
2180 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2184 #define __Pyx_init_assertions_enabled()
2185 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2186 #define __pyx_assertions_enabled() (1)
2187 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2188 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2189 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2190 static int __pyx_assertions_enabled_flag;
2191 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2192 #undef __Pyx_init_assertions_enabled
2193 static void __Pyx_init_assertions_enabled(
void) {
2194 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2197 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2201 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2204 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2205 int result = PySequence_Contains(seq, item);
2206 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2210 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2213 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2216 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2219 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse);
2222 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2225 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2226 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2228 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2232 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2233 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2235 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2239 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2240 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2241 #if __STDC_VERSION__ >= 201112L
2242 #include <stdalign.h>
2244 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2245 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2247 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2249 enum __Pyx_ImportType_CheckSize_0_29_36 {
2250 __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2251 __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2252 __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2254 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2258 static void* __Pyx_GetVtable(PyObject *dict);
2261 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2264 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2267 static int __Pyx_setup_reduce(PyObject* type_obj);
2270 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2273 #define __Pyx_CyFunction_USED 1
2274 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2275 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2276 #define __Pyx_CYFUNCTION_CCLASS 0x04
2277 #define __Pyx_CyFunction_GetClosure(f)\
2278 (((__pyx_CyFunctionObject *) (f))->func_closure)
2279 #define __Pyx_CyFunction_GetClassObj(f)\
2280 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2281 #define __Pyx_CyFunction_Defaults(type, f)\
2282 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2283 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2284 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2286 PyCFunctionObject func;
2287 #if PY_VERSION_HEX < 0x030500A0
2288 PyObject *func_weakreflist;
2290 PyObject *func_dict;
2291 PyObject *func_name;
2292 PyObject *func_qualname;
2294 PyObject *func_globals;
2295 PyObject *func_code;
2296 PyObject *func_closure;
2297 PyObject *func_classobj;
2299 int defaults_pyobjects;
2300 size_t defaults_size;
2302 PyObject *defaults_tuple;
2303 PyObject *defaults_kwdict;
2304 PyObject *(*defaults_getter)(PyObject *);
2305 PyObject *func_annotations;
2306 } __pyx_CyFunctionObject;
2307 static PyTypeObject *__pyx_CyFunctionType = 0;
2308 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2309 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2310 int flags, PyObject* qualname,
2312 PyObject *module, PyObject *globals,
2314 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2317 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2319 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2321 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2323 static int __pyx_CyFunction_init(
void);
2326 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2327 int flags, PyObject* qualname,
2329 PyObject *module, PyObject *globals,
2333 #ifdef CYTHON_CLINE_IN_TRACEBACK
2334 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2336 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2341 PyCodeObject* code_object;
2343 } __Pyx_CodeObjectCacheEntry;
2344 struct __Pyx_CodeObjectCache {
2347 __Pyx_CodeObjectCacheEntry* entries;
2349 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2350 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2351 static PyCodeObject *__pyx_find_code_object(
int code_line);
2352 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2355 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2356 int py_line,
const char *filename);
2358 #if PY_MAJOR_VERSION < 3
2359 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2360 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2362 #define __Pyx_GetBuffer PyObject_GetBuffer
2363 #define __Pyx_ReleaseBuffer PyBuffer_Release
2369 Py_ssize_t shape, strides, suboffsets;
2370 } __Pyx_Buf_DimInfo;
2376 __Pyx_Buffer *rcbuffer;
2378 __Pyx_Buf_DimInfo diminfo[8];
2379 } __Pyx_LocalBuf_ND;
2382 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2385 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2386 __Pyx_memviewslice *slice2,
2387 int ndim,
size_t itemsize);
2390 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2393 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2394 #define __Pyx_HAS_GCC_DIAGNOSTIC
2398 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2401 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2402 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2403 __Pyx_BufFmt_StackElem* stack,
2404 __Pyx_TypeInfo* type);
2407 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2410 static int __Pyx_ValidateAndInit_memviewslice(
2415 __Pyx_TypeInfo *dtype,
2416 __Pyx_BufFmt_StackElem stack[],
2417 __Pyx_memviewslice *memviewslice,
2418 PyObject *original_obj);
2421 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *,
int writable_flag);
2424 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2427 #ifndef __Pyx_CppExn2PyErr
2430 #include <stdexcept>
2432 static void __Pyx_CppExn2PyErr() {
2434 if (PyErr_Occurred())
2438 }
catch (
const std::bad_alloc& exn) {
2439 PyErr_SetString(PyExc_MemoryError, exn.what());
2440 }
catch (
const std::bad_cast& exn) {
2441 PyErr_SetString(PyExc_TypeError, exn.what());
2442 }
catch (
const std::bad_typeid& exn) {
2443 PyErr_SetString(PyExc_TypeError, exn.what());
2444 }
catch (
const std::domain_error& exn) {
2445 PyErr_SetString(PyExc_ValueError, exn.what());
2446 }
catch (
const std::invalid_argument& exn) {
2447 PyErr_SetString(PyExc_ValueError, exn.what());
2448 }
catch (
const std::ios_base::failure& exn) {
2449 PyErr_SetString(PyExc_IOError, exn.what());
2450 }
catch (
const std::out_of_range& exn) {
2451 PyErr_SetString(PyExc_IndexError, exn.what());
2452 }
catch (
const std::overflow_error& exn) {
2453 PyErr_SetString(PyExc_OverflowError, exn.what());
2454 }
catch (
const std::range_error& exn) {
2455 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2456 }
catch (
const std::underflow_error& exn) {
2457 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2458 }
catch (
const std::exception& exn) {
2459 PyErr_SetString(PyExc_RuntimeError, exn.what());
2463 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
2469 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *,
int writable_flag);
2472 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2475 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *,
int writable_flag);
2478 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *,
int writable_flag);
2481 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2484 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2487 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2490 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2493 static __Pyx_memviewslice
2494 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2495 const char *mode,
int ndim,
2496 size_t sizeof_dtype,
int contig_flag,
2497 int dtype_is_object);
2500 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2503 static CYTHON_INLINE
LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *);
2506 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2509 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2512 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2515 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2518 static int __Pyx_check_binary_version(
void);
2521 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2523 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2524 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2525 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2526 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2527 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2528 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2529 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2530 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2531 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2532 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2539 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2550 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2551 static PyTypeObject *__pyx_array_type = 0;
2552 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2553 static PyTypeObject *__pyx_memoryview_type = 0;
2554 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2555 static PyObject *
generic = 0;
2556 static PyObject *strided = 0;
2557 static PyObject *indirect = 0;
2558 static PyObject *contiguous = 0;
2559 static PyObject *indirect_contiguous = 0;
2560 static int __pyx_memoryview_thread_locks_used;
2561 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2562 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2563 static void *__pyx_align_pointer(
void *,
size_t);
2564 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2565 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2566 static PyObject *_unellipsify(PyObject *,
int);
2567 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2568 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2569 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2570 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2571 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2572 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2573 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2574 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2575 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2576 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2577 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2578 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2579 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2580 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2581 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2582 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2583 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2584 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2585 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2586 static int __pyx_memoryview_err(PyObject *,
char *);
2587 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2588 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2589 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2590 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2591 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2592 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2593 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2594 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2595 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2596 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2597 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2598 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2599 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2600 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2601 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2604 static PyObject *__pyx_builtin_ValueError;
2605 static PyObject *__pyx_builtin_TypeError;
2606 static PyObject *__pyx_builtin_MemoryError;
2607 static PyObject *__pyx_builtin_enumerate;
2608 static PyObject *__pyx_builtin_range;
2609 static PyObject *__pyx_builtin_Ellipsis;
2610 static PyObject *__pyx_builtin_id;
2611 static PyObject *__pyx_builtin_IndexError;
2612 static const char __pyx_k_A[] =
"A";
2613 static const char __pyx_k_O[] =
"O";
2614 static const char __pyx_k_c[] =
"c";
2615 static const char __pyx_k_id[] =
"id";
2616 static const char __pyx_k_new[] =
"__new__";
2617 static const char __pyx_k_obj[] =
"obj";
2618 static const char __pyx_k_base[] =
"base";
2619 static const char __pyx_k_copy[] =
"copy";
2620 static const char __pyx_k_data[] =
"data";
2621 static const char __pyx_k_dict[] =
"__dict__";
2622 static const char __pyx_k_main[] =
"__main__";
2623 static const char __pyx_k_mode[] =
"mode";
2624 static const char __pyx_k_name[] =
"name";
2625 static const char __pyx_k_ndim[] =
"ndim";
2626 static const char __pyx_k_pack[] =
"pack";
2627 static const char __pyx_k_self[] =
"self";
2628 static const char __pyx_k_size[] =
"size";
2629 static const char __pyx_k_step[] =
"step";
2630 static const char __pyx_k_stop[] =
"stop";
2631 static const char __pyx_k_test[] =
"__test__";
2632 static const char __pyx_k_ASCII[] =
"ASCII";
2633 static const char __pyx_k_class[] =
"__class__";
2634 static const char __pyx_k_dtype[] =
"dtype";
2635 static const char __pyx_k_error[] =
"error";
2636 static const char __pyx_k_flags[] =
"flags";
2637 static const char __pyx_k_numpy[] =
"numpy";
2638 static const char __pyx_k_range[] =
"range";
2639 static const char __pyx_k_shape[] =
"shape";
2640 static const char __pyx_k_start[] =
"start";
2641 static const char __pyx_k_astype[] =
"astype";
2642 static const char __pyx_k_encode[] =
"encode";
2643 static const char __pyx_k_format[] =
"format";
2644 static const char __pyx_k_import[] =
"__import__";
2645 static const char __pyx_k_indptr[] =
"indptr";
2646 static const char __pyx_k_name_2[] =
"__name__";
2647 static const char __pyx_k_pickle[] =
"pickle";
2648 static const char __pyx_k_reduce[] =
"__reduce__";
2649 static const char __pyx_k_struct[] =
"struct";
2650 static const char __pyx_k_unpack[] =
"unpack";
2651 static const char __pyx_k_update[] =
"update";
2652 static const char __pyx_k_float32[] =
"float32";
2653 static const char __pyx_k_float64[] =
"float64";
2654 static const char __pyx_k_fortran[] =
"fortran";
2655 static const char __pyx_k_indices[] =
"indices";
2656 static const char __pyx_k_memview[] =
"memview";
2657 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2658 static const char __pyx_k_float128[] =
"float128";
2659 static const char __pyx_k_getstate[] =
"__getstate__";
2660 static const char __pyx_k_issparse[] =
"issparse";
2661 static const char __pyx_k_itemsize[] =
"itemsize";
2662 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2663 static const char __pyx_k_setstate[] =
"__setstate__";
2664 static const char __pyx_k_A_indices[] =
"A_indices";
2665 static const char __pyx_k_TypeError[] =
"TypeError";
2666 static const char __pyx_k_enumerate[] =
"enumerate";
2667 static const char __pyx_k_pycMatrix[] =
"pycMatrix";
2668 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2669 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2670 static const char __pyx_k_A_num_rows[] =
"A_num_rows";
2671 static const char __pyx_k_IndexError[] =
"IndexError";
2672 static const char __pyx_k_ValueError[] =
"ValueError";
2673 static const char __pyx_k_csr_matrix[] =
"csr_matrix";
2674 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2675 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2676 static const char __pyx_k_MemoryError[] =
"MemoryError";
2677 static const char __pyx_k_PickleError[] =
"PickleError";
2678 static const char __pyx_k_A_data_float[] =
"A_data_float";
2679 static const char __pyx_k_A_indices_mv[] =
"A_indices_mv";
2680 static const char __pyx_k_C_CONTIGUOUS[] =
"C_CONTIGUOUS";
2681 static const char __pyx_k_F_CONTIGUOUS[] =
"F_CONTIGUOUS";
2682 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2683 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2684 static const char __pyx_k_sort_indices[] =
"sort_indices";
2685 static const char __pyx_k_stringsource[] =
"stringsource";
2686 static const char __pyx_k_A_data_double[] =
"A_data_double";
2687 static const char __pyx_k_A_num_columns[] =
"A_num_columns";
2688 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2689 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2690 static const char __pyx_k_A_is_row_major[] =
"A_is_row_major";
2691 static const char __pyx_k_isspmatrix_csc[] =
"isspmatrix_csc";
2692 static const char __pyx_k_isspmatrix_csr[] =
"isspmatrix_csr";
2693 static const char __pyx_k_A_data_float_mv[] =
"A_data_float_mv";
2694 static const char __pyx_k_A_index_pointer[] =
"A_index_pointer";
2695 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2696 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2697 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2698 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2699 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2700 static const char __pyx_k_A_cannot_be_None[] =
"A cannot be None.";
2701 static const char __pyx_k_A_data_double_mv[] =
"A_data_double_mv";
2702 static const char __pyx_k_A_data_float_mv_c[] =
"A_data_float_mv_c";
2703 static const char __pyx_k_A_data_float_mv_f[] =
"A_data_float_mv_f";
2704 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2705 static const char __pyx_k_A_data_double_mv_c[] =
"A_data_double_mv_c";
2706 static const char __pyx_k_A_data_double_mv_f[] =
"A_data_double_mv_f";
2707 static const char __pyx_k_A_data_long_double[] =
"A_data_long_double";
2708 static const char __pyx_k_A_index_pointer_mv[] =
"A_index_pointer_mv";
2709 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2710 static const char __pyx_k_has_sorted_indices[] =
"has_sorted_indices";
2711 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2712 static const char __pyx_k_set_csc_matrix_float[] =
"set_csc_matrix_float";
2713 static const char __pyx_k_set_csr_matrix_float[] =
"set_csr_matrix_float";
2714 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2715 static const char __pyx_k_A_data_long_double_mv[] =
"A_data_long_double_mv";
2716 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2717 static const char __pyx_k_set_csc_matrix_double[] =
"set_csc_matrix_double";
2718 static const char __pyx_k_set_csr_matrix_double[] =
"set_csr_matrix_double";
2719 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2720 static const char __pyx_k_set_dense_matrix_float[] =
"set_dense_matrix_float";
2721 static const char __pyx_k_A_data_long_double_mv_c[] =
"A_data_long_double_mv_c";
2722 static const char __pyx_k_A_data_long_double_mv_f[] =
"A_data_long_double_mv_f";
2723 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2724 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2725 static const char __pyx_k_set_dense_matrix_double[] =
"set_dense_matrix_double";
2726 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2727 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2728 static const char __pyx_k_pycMatrix___reduce_cython[] =
"pycMatrix.__reduce_cython__";
2729 static const char __pyx_k_set_csc_matrix_long_double[] =
"set_csc_matrix_long_double";
2730 static const char __pyx_k_set_csr_matrix_long_double[] =
"set_csr_matrix_long_double";
2731 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2732 static const char __pyx_k_pycMatrix___setstate_cython[] =
"pycMatrix.__setstate_cython__";
2733 static const char __pyx_k_set_dense_matrix_long_double[] =
"set_dense_matrix_long_double";
2734 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2735 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float";
2736 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float";
2737 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2738 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double";
2739 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double";
2740 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] =
"pycMatrix.set_dense_matrix_long_double";
2741 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2742 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2743 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2744 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2745 static const char __pyx_k_Data_type_should_be_float32_floa[] =
"Data type should be \"float32\", \"float64\", or \"float128\".";
2746 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2747 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2748 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2749 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] =
"Input matrix should be a 2-dimensional array.";
2750 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2751 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] =
"Matrix A should be either C or F contiguous.";
2752 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2753 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2754 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2755 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] =
"imate/_c_linear_operator/py_c_matrix.pyx";
2756 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2757 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] =
"pycMatrix.set_csc_matrix_long_double";
2758 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] =
"pycMatrix.set_csr_matrix_long_double";
2759 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] =
"pycMatrix.set_dense_matrix_double";
2760 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float";
2761 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2762 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] =
"imate._c_linear_operator.py_c_matrix";
2763 static PyObject *__pyx_n_s_A;
2764 static PyObject *__pyx_n_s_ASCII;
2765 static PyObject *__pyx_kp_u_A_cannot_be_None;
2766 static PyObject *__pyx_n_s_A_data_double;
2767 static PyObject *__pyx_n_s_A_data_double_mv;
2768 static PyObject *__pyx_n_s_A_data_double_mv_c;
2769 static PyObject *__pyx_n_s_A_data_double_mv_f;
2770 static PyObject *__pyx_n_s_A_data_float;
2771 static PyObject *__pyx_n_s_A_data_float_mv;
2772 static PyObject *__pyx_n_s_A_data_float_mv_c;
2773 static PyObject *__pyx_n_s_A_data_float_mv_f;
2774 static PyObject *__pyx_n_s_A_data_long_double;
2775 static PyObject *__pyx_n_s_A_data_long_double_mv;
2776 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2777 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2778 static PyObject *__pyx_n_s_A_index_pointer;
2779 static PyObject *__pyx_n_s_A_index_pointer_mv;
2780 static PyObject *__pyx_n_s_A_indices;
2781 static PyObject *__pyx_n_s_A_indices_mv;
2782 static PyObject *__pyx_n_s_A_is_row_major;
2783 static PyObject *__pyx_n_s_A_num_columns;
2784 static PyObject *__pyx_n_s_A_num_rows;
2785 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2786 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2787 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2788 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2789 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2790 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2791 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2792 static PyObject *__pyx_n_s_Ellipsis;
2793 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2794 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2795 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2796 static PyObject *__pyx_n_s_IndexError;
2797 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2798 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2799 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2800 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2801 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2802 static PyObject *__pyx_n_s_MemoryError;
2803 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2804 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2805 static PyObject *__pyx_n_b_O;
2806 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2807 static PyObject *__pyx_n_s_PickleError;
2808 static PyObject *__pyx_n_s_TypeError;
2809 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2810 static PyObject *__pyx_n_s_ValueError;
2811 static PyObject *__pyx_n_s_View_MemoryView;
2812 static PyObject *__pyx_n_s_allocate_buffer;
2813 static PyObject *__pyx_n_s_astype;
2814 static PyObject *__pyx_n_s_base;
2815 static PyObject *__pyx_n_s_c;
2816 static PyObject *__pyx_n_u_c;
2817 static PyObject *__pyx_n_s_class;
2818 static PyObject *__pyx_n_s_cline_in_traceback;
2819 static PyObject *__pyx_kp_s_contiguous_and_direct;
2820 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2821 static PyObject *__pyx_n_s_copy;
2822 static PyObject *__pyx_n_s_csr_matrix;
2823 static PyObject *__pyx_n_s_data;
2824 static PyObject *__pyx_n_s_dict;
2825 static PyObject *__pyx_n_s_dtype;
2826 static PyObject *__pyx_n_s_dtype_is_object;
2827 static PyObject *__pyx_n_s_encode;
2828 static PyObject *__pyx_n_s_enumerate;
2829 static PyObject *__pyx_n_s_error;
2830 static PyObject *__pyx_n_s_flags;
2831 static PyObject *__pyx_n_b_float128;
2832 static PyObject *__pyx_n_b_float32;
2833 static PyObject *__pyx_n_b_float64;
2834 static PyObject *__pyx_n_s_format;
2835 static PyObject *__pyx_n_s_fortran;
2836 static PyObject *__pyx_n_u_fortran;
2837 static PyObject *__pyx_n_s_getstate;
2838 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2839 static PyObject *__pyx_n_s_has_sorted_indices;
2840 static PyObject *__pyx_n_s_id;
2841 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2842 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2843 static PyObject *__pyx_n_s_import;
2844 static PyObject *__pyx_n_s_indices;
2845 static PyObject *__pyx_n_s_indptr;
2846 static PyObject *__pyx_n_s_issparse;
2847 static PyObject *__pyx_n_s_isspmatrix_csc;
2848 static PyObject *__pyx_n_s_isspmatrix_csr;
2849 static PyObject *__pyx_n_s_itemsize;
2850 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2851 static PyObject *__pyx_n_s_main;
2852 static PyObject *__pyx_n_s_memview;
2853 static PyObject *__pyx_n_s_mode;
2854 static PyObject *__pyx_n_s_name;
2855 static PyObject *__pyx_n_s_name_2;
2856 static PyObject *__pyx_n_s_ndim;
2857 static PyObject *__pyx_n_s_new;
2858 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2859 static PyObject *__pyx_n_s_numpy;
2860 static PyObject *__pyx_n_s_obj;
2861 static PyObject *__pyx_n_s_pack;
2862 static PyObject *__pyx_n_s_pickle;
2863 static PyObject *__pyx_n_s_pycMatrix;
2864 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2865 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2866 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2867 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2868 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2869 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2870 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2871 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2872 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2873 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2874 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2875 static PyObject *__pyx_n_s_pyx_PickleError;
2876 static PyObject *__pyx_n_s_pyx_checksum;
2877 static PyObject *__pyx_n_s_pyx_getbuffer;
2878 static PyObject *__pyx_n_s_pyx_result;
2879 static PyObject *__pyx_n_s_pyx_state;
2880 static PyObject *__pyx_n_s_pyx_type;
2881 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2882 static PyObject *__pyx_n_s_pyx_vtable;
2883 static PyObject *__pyx_n_s_range;
2884 static PyObject *__pyx_n_s_reduce;
2885 static PyObject *__pyx_n_s_reduce_cython;
2886 static PyObject *__pyx_n_s_reduce_ex;
2887 static PyObject *__pyx_n_s_scipy_sparse;
2888 static PyObject *__pyx_n_s_self;
2889 static PyObject *__pyx_n_s_set_csc_matrix_double;
2890 static PyObject *__pyx_n_s_set_csc_matrix_float;
2891 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2892 static PyObject *__pyx_n_s_set_csr_matrix_double;
2893 static PyObject *__pyx_n_s_set_csr_matrix_float;
2894 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2895 static PyObject *__pyx_n_s_set_dense_matrix_double;
2896 static PyObject *__pyx_n_s_set_dense_matrix_float;
2897 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2898 static PyObject *__pyx_n_s_setstate;
2899 static PyObject *__pyx_n_s_setstate_cython;
2900 static PyObject *__pyx_n_s_shape;
2901 static PyObject *__pyx_n_s_size;
2902 static PyObject *__pyx_n_s_sort_indices;
2903 static PyObject *__pyx_n_s_start;
2904 static PyObject *__pyx_n_s_step;
2905 static PyObject *__pyx_n_s_stop;
2906 static PyObject *__pyx_kp_s_strided_and_direct;
2907 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2908 static PyObject *__pyx_kp_s_strided_and_indirect;
2909 static PyObject *__pyx_kp_s_stringsource;
2910 static PyObject *__pyx_n_s_struct;
2911 static PyObject *__pyx_n_s_test;
2912 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2913 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2914 static PyObject *__pyx_n_s_unpack;
2915 static PyObject *__pyx_n_s_update;
2916 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2917 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2918 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2919 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2920 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2921 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2922 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2923 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2924 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2925 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2926 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self);
2927 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2928 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2929 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2930 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2931 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2932 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2933 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2934 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2935 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2936 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2937 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2938 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2939 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2940 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2941 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2942 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2943 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2944 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2945 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2946 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2947 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2948 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2949 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2950 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2951 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2952 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2953 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2954 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2955 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2956 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2957 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2958 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2959 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2960 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2961 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2962 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2963 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2964 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2965 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2967 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2968 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2969 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2970 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
2971 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2972 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2973 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2974 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2975 static PyObject *__pyx_int_0;
2976 static PyObject *__pyx_int_1;
2977 static PyObject *__pyx_int_2;
2978 static PyObject *__pyx_int_112105877;
2979 static PyObject *__pyx_int_136983863;
2980 static PyObject *__pyx_int_184977713;
2981 static PyObject *__pyx_int_neg_1;
2982 static PyObject *__pyx_tuple_;
2983 static PyObject *__pyx_tuple__2;
2984 static PyObject *__pyx_tuple__3;
2985 static PyObject *__pyx_tuple__5;
2986 static PyObject *__pyx_slice__32;
2987 static PyObject *__pyx_tuple__15;
2988 static PyObject *__pyx_tuple__17;
2989 static PyObject *__pyx_tuple__18;
2990 static PyObject *__pyx_tuple__19;
2991 static PyObject *__pyx_tuple__20;
2992 static PyObject *__pyx_tuple__21;
2993 static PyObject *__pyx_tuple__22;
2994 static PyObject *__pyx_tuple__23;
2995 static PyObject *__pyx_tuple__24;
2996 static PyObject *__pyx_tuple__25;
2997 static PyObject *__pyx_tuple__26;
2998 static PyObject *__pyx_tuple__27;
2999 static PyObject *__pyx_tuple__28;
3000 static PyObject *__pyx_tuple__29;
3001 static PyObject *__pyx_tuple__30;
3002 static PyObject *__pyx_tuple__31;
3003 static PyObject *__pyx_tuple__33;
3004 static PyObject *__pyx_tuple__34;
3005 static PyObject *__pyx_tuple__35;
3006 static PyObject *__pyx_tuple__37;
3007 static PyObject *__pyx_tuple__38;
3008 static PyObject *__pyx_tuple__39;
3009 static PyObject *__pyx_tuple__40;
3010 static PyObject *__pyx_tuple__41;
3011 static PyObject *__pyx_tuple__42;
3012 static PyObject *__pyx_tuple__43;
3013 static PyObject *__pyx_tuple__44;
3014 static PyObject *__pyx_tuple__45;
3015 static PyObject *__pyx_tuple__46;
3016 static PyObject *__pyx_tuple__47;
3017 static PyObject *__pyx_tuple__48;
3018 static PyObject *__pyx_tuple__49;
3019 static PyObject *__pyx_tuple__50;
3020 static PyObject *__pyx_tuple__51;
3021 static PyObject *__pyx_tuple__52;
3022 static PyObject *__pyx_tuple__53;
3023 static PyObject *__pyx_tuple__54;
3024 static PyObject *__pyx_codeobj__4;
3025 static PyObject *__pyx_codeobj__6;
3026 static PyObject *__pyx_codeobj__7;
3027 static PyObject *__pyx_codeobj__8;
3028 static PyObject *__pyx_codeobj__9;
3029 static PyObject *__pyx_codeobj__10;
3030 static PyObject *__pyx_codeobj__11;
3031 static PyObject *__pyx_codeobj__12;
3032 static PyObject *__pyx_codeobj__13;
3033 static PyObject *__pyx_codeobj__14;
3034 static PyObject *__pyx_codeobj__16;
3035 static PyObject *__pyx_codeobj__36;
3047 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3048 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3049 PyObject *__pyx_v_A = 0;
3050 int __pyx_lineno = 0;
3051 const char *__pyx_filename = NULL;
3052 int __pyx_clineno = 0;
3054 __Pyx_RefNannyDeclarations
3055 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3057 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
3058 PyObject* values[1] = {0};
3059 if (unlikely(__pyx_kwds)) {
3061 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3063 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3066 default:
goto __pyx_L5_argtuple_error;
3068 kw_args = PyDict_Size(__pyx_kwds);
3071 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3072 else goto __pyx_L5_argtuple_error;
3074 if (unlikely(kw_args > 0)) {
3075 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
3077 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3078 goto __pyx_L5_argtuple_error;
3080 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3082 __pyx_v_A = values[0];
3084 goto __pyx_L4_argument_unpacking_done;
3085 __pyx_L5_argtuple_error:;
3086 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
3088 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3089 __Pyx_RefNannyFinishContext();
3091 __pyx_L4_argument_unpacking_done:;
3092 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
3095 __Pyx_RefNannyFinishContext();
3099 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
3101 __Pyx_TraceDeclarations
3102 __Pyx_RefNannyDeclarations
3105 PyObject *__pyx_t_3 = NULL;
3106 PyObject *__pyx_t_4 = NULL;
3107 PyObject *__pyx_t_5 = NULL;
3108 int __pyx_lineno = 0;
3109 const char *__pyx_filename = NULL;
3110 int __pyx_clineno = 0;
3111 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3112 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
3121 __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3122 __pyx_t_1 = (__pyx_v_A == Py_None);
3123 __pyx_t_2 = (__pyx_t_1 != 0);
3124 if (unlikely(__pyx_t_2)) {
3133 __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
3134 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
3135 __Pyx_GOTREF(__pyx_t_3);
3136 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3137 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3138 __PYX_ERR(0, 126, __pyx_L1_error)
3156 __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
3157 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
3158 __Pyx_GOTREF(__pyx_t_3);
3159 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
3160 __Pyx_GOTREF(__pyx_t_4);
3161 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3162 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
3163 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3164 if (unlikely(__pyx_t_2)) {
3173 __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
3174 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
3175 __Pyx_GOTREF(__pyx_t_4);
3176 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3177 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3178 __PYX_ERR(0, 129, __pyx_L1_error)
3196 __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
3197 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
3198 __Pyx_GOTREF(__pyx_t_4);
3199 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
3200 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3210 __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
3211 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float32");
3230 __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3231 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3232 __Pyx_GOTREF(__pyx_t_4);
3233 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3244 __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3245 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float64");
3264 __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3265 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3266 __Pyx_GOTREF(__pyx_t_4);
3267 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3268 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3269 if (likely(__pyx_t_2)) {
3278 __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3279 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float128");
3298 __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3300 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3301 __Pyx_GOTREF(__pyx_t_4);
3302 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3304 __PYX_ERR(0, 142, __pyx_L1_error)
3315 __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3316 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3317 __Pyx_GOTREF(__pyx_t_3);
3319 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3320 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3321 if (likely(__pyx_t_5)) {
3322 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3323 __Pyx_INCREF(__pyx_t_5);
3324 __Pyx_INCREF(
function);
3325 __Pyx_DECREF_SET(__pyx_t_3,
function);
3328 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3329 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3330 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3331 __Pyx_GOTREF(__pyx_t_4);
3332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3333 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3334 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3344 __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3345 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3346 __Pyx_GOTREF(__pyx_t_3);
3348 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3349 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3350 if (likely(__pyx_t_5)) {
3351 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3352 __Pyx_INCREF(__pyx_t_5);
3353 __Pyx_INCREF(
function);
3354 __Pyx_DECREF_SET(__pyx_t_3,
function);
3357 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3358 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3359 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3360 __Pyx_GOTREF(__pyx_t_4);
3361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3362 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3363 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3373 __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3374 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3375 __Pyx_GOTREF(__pyx_t_4);
3376 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3377 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3378 __pyx_t_1 = ((!__pyx_t_2) != 0);
3388 __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3389 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3390 __Pyx_GOTREF(__pyx_t_3);
3392 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3393 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3394 if (likely(__pyx_t_5)) {
3395 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3396 __Pyx_INCREF(__pyx_t_5);
3397 __Pyx_INCREF(
function);
3398 __Pyx_DECREF_SET(__pyx_t_3,
function);
3401 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3402 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3403 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3404 __Pyx_GOTREF(__pyx_t_4);
3405 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3406 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3424 __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3425 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3426 __Pyx_GOTREF(__pyx_t_4);
3427 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3428 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3438 __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3439 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3440 __Pyx_GOTREF(__pyx_t_3);
3442 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3443 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3444 if (likely(__pyx_t_5)) {
3445 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3446 __Pyx_INCREF(__pyx_t_5);
3447 __Pyx_INCREF(
function);
3448 __Pyx_DECREF_SET(__pyx_t_3,
function);
3451 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3452 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3453 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3454 __Pyx_GOTREF(__pyx_t_4);
3455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3456 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3475 __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3476 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3477 __Pyx_GOTREF(__pyx_t_4);
3478 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3479 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3489 __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3490 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3491 __Pyx_GOTREF(__pyx_t_3);
3493 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3494 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3495 if (likely(__pyx_t_5)) {
3496 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3497 __Pyx_INCREF(__pyx_t_5);
3498 __Pyx_INCREF(
function);
3499 __Pyx_DECREF_SET(__pyx_t_3,
function);
3502 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3503 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3504 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3505 __Pyx_GOTREF(__pyx_t_4);
3506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3526 __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3527 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3528 __Pyx_GOTREF(__pyx_t_4);
3529 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3530 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3540 __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3541 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3542 __Pyx_GOTREF(__pyx_t_3);
3544 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3545 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3546 if (likely(__pyx_t_5)) {
3547 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3548 __Pyx_INCREF(__pyx_t_5);
3549 __Pyx_INCREF(
function);
3550 __Pyx_DECREF_SET(__pyx_t_3,
function);
3553 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3554 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3555 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3556 __Pyx_GOTREF(__pyx_t_4);
3557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3558 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3587 __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3588 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3589 __Pyx_GOTREF(__pyx_t_3);
3591 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3592 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3593 if (likely(__pyx_t_5)) {
3594 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3595 __Pyx_INCREF(__pyx_t_5);
3596 __Pyx_INCREF(
function);
3597 __Pyx_DECREF_SET(__pyx_t_3,
function);
3600 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3601 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3602 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3603 __Pyx_GOTREF(__pyx_t_4);
3604 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3605 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3606 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3616 __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3617 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3618 __Pyx_GOTREF(__pyx_t_4);
3619 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3620 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3621 __pyx_t_2 = ((!__pyx_t_1) != 0);
3631 __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3632 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3633 __Pyx_GOTREF(__pyx_t_3);
3635 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3636 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3637 if (likely(__pyx_t_5)) {
3638 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3639 __Pyx_INCREF(__pyx_t_5);
3640 __Pyx_INCREF(
function);
3641 __Pyx_DECREF_SET(__pyx_t_3,
function);
3644 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3645 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3646 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3647 __Pyx_GOTREF(__pyx_t_4);
3648 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3649 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3667 __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3668 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3669 __Pyx_GOTREF(__pyx_t_4);
3670 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3671 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3681 __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3682 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3683 __Pyx_GOTREF(__pyx_t_3);
3685 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3686 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3687 if (likely(__pyx_t_5)) {
3688 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3689 __Pyx_INCREF(__pyx_t_5);
3690 __Pyx_INCREF(
function);
3691 __Pyx_DECREF_SET(__pyx_t_3,
function);
3694 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3695 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3696 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3697 __Pyx_GOTREF(__pyx_t_4);
3698 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3699 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3718 __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3719 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3720 __Pyx_GOTREF(__pyx_t_4);
3721 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3732 __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3733 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3734 __Pyx_GOTREF(__pyx_t_3);
3736 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3737 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3738 if (likely(__pyx_t_5)) {
3739 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3740 __Pyx_INCREF(__pyx_t_5);
3741 __Pyx_INCREF(
function);
3742 __Pyx_DECREF_SET(__pyx_t_3,
function);
3745 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3746 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3747 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3748 __Pyx_GOTREF(__pyx_t_4);
3749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3750 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3769 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3770 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3771 __Pyx_GOTREF(__pyx_t_4);
3772 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3773 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3783 __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3784 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3785 __Pyx_GOTREF(__pyx_t_3);
3787 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3788 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3789 if (likely(__pyx_t_5)) {
3790 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3791 __Pyx_INCREF(__pyx_t_5);
3792 __Pyx_INCREF(
function);
3793 __Pyx_DECREF_SET(__pyx_t_3,
function);
3796 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3797 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3798 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3799 __Pyx_GOTREF(__pyx_t_4);
3800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3830 __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3832 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3833 __Pyx_GOTREF(__pyx_t_3);
3835 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3836 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3837 if (likely(__pyx_t_5)) {
3838 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3839 __Pyx_INCREF(__pyx_t_5);
3840 __Pyx_INCREF(
function);
3841 __Pyx_DECREF_SET(__pyx_t_3,
function);
3844 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3845 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3846 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3847 __Pyx_GOTREF(__pyx_t_4);
3848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3849 __Pyx_GIVEREF(__pyx_t_4);
3850 __Pyx_GOTREF(__pyx_v_self->A_csr);
3851 __Pyx_DECREF(__pyx_v_self->A_csr);
3852 __pyx_v_self->A_csr = __pyx_t_4;
3862 __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3863 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3864 __Pyx_GOTREF(__pyx_t_4);
3865 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3866 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3867 __pyx_t_1 = ((!__pyx_t_2) != 0);
3877 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3878 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_3);
3881 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3882 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3883 if (likely(__pyx_t_5)) {
3884 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3885 __Pyx_INCREF(__pyx_t_5);
3886 __Pyx_INCREF(
function);
3887 __Pyx_DECREF_SET(__pyx_t_3,
function);
3890 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3891 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3892 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3893 __Pyx_GOTREF(__pyx_t_4);
3894 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3913 __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
3914 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
3915 __Pyx_GOTREF(__pyx_t_4);
3916 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
3917 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3927 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3928 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
3929 __Pyx_GOTREF(__pyx_t_3);
3931 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3932 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3933 if (likely(__pyx_t_5)) {
3934 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3935 __Pyx_INCREF(__pyx_t_5);
3936 __Pyx_INCREF(
function);
3937 __Pyx_DECREF_SET(__pyx_t_3,
function);
3940 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3941 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3942 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3943 __Pyx_GOTREF(__pyx_t_4);
3944 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3945 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3964 __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
3965 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
3966 __Pyx_GOTREF(__pyx_t_4);
3967 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
3968 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3978 __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
3979 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
3980 __Pyx_GOTREF(__pyx_t_3);
3982 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3983 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3984 if (likely(__pyx_t_5)) {
3985 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3986 __Pyx_INCREF(__pyx_t_5);
3987 __Pyx_INCREF(
function);
3988 __Pyx_DECREF_SET(__pyx_t_3,
function);
3991 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3992 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3993 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
3994 __Pyx_GOTREF(__pyx_t_4);
3995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3996 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4015 __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
4016 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
4017 __Pyx_GOTREF(__pyx_t_4);
4018 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
4019 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4029 __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
4030 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
4031 __Pyx_GOTREF(__pyx_t_3);
4033 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4034 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4035 if (likely(__pyx_t_5)) {
4036 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4037 __Pyx_INCREF(__pyx_t_5);
4038 __Pyx_INCREF(
function);
4039 __Pyx_DECREF_SET(__pyx_t_3,
function);
4042 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4043 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4044 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4045 __Pyx_GOTREF(__pyx_t_4);
4046 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4047 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4078 __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
4080 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
4081 __Pyx_GOTREF(__pyx_t_4);
4082 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
4083 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4093 __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
4094 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4095 __Pyx_GOTREF(__pyx_t_3);
4097 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4098 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4099 if (likely(__pyx_t_5)) {
4100 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4101 __Pyx_INCREF(__pyx_t_5);
4102 __Pyx_INCREF(
function);
4103 __Pyx_DECREF_SET(__pyx_t_3,
function);
4106 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4107 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4108 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4109 __Pyx_GOTREF(__pyx_t_4);
4110 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4111 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4130 __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
4131 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
4132 __Pyx_GOTREF(__pyx_t_4);
4133 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
4134 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4144 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4145 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
4146 __Pyx_GOTREF(__pyx_t_3);
4148 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4149 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4150 if (likely(__pyx_t_5)) {
4151 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4152 __Pyx_INCREF(__pyx_t_5);
4153 __Pyx_INCREF(
function);
4154 __Pyx_DECREF_SET(__pyx_t_3,
function);
4157 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4158 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4159 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
4160 __Pyx_GOTREF(__pyx_t_4);
4161 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4162 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4181 __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
4182 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
4183 __Pyx_GOTREF(__pyx_t_4);
4184 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
4185 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4195 __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4196 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4197 __Pyx_GOTREF(__pyx_t_3);
4199 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4200 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4201 if (likely(__pyx_t_5)) {
4202 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4203 __Pyx_INCREF(__pyx_t_5);
4204 __Pyx_INCREF(
function);
4205 __Pyx_DECREF_SET(__pyx_t_3,
function);
4208 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4209 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4210 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4211 __Pyx_GOTREF(__pyx_t_4);
4212 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4239 __Pyx_XDECREF(__pyx_t_3);
4240 __Pyx_XDECREF(__pyx_t_4);
4241 __Pyx_XDECREF(__pyx_t_5);
4242 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4245 __Pyx_TraceReturn(Py_None, 0);
4246 __Pyx_RefNannyFinishContext();
4259 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4260 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4261 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4262 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4263 PyObject *__pyx_r = 0;
4264 __Pyx_RefNannyDeclarations
4265 __Pyx_RefNannySetupContext(
"set_dense_matrix_float (wrapper)", 0);
4266 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4269 __Pyx_RefNannyFinishContext();
4273 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4276 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4277 __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4278 __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4279 float *__pyx_v_A_data_float;
4280 PyObject *__pyx_r = NULL;
4281 __Pyx_TraceDeclarations
4282 __Pyx_RefNannyDeclarations
4283 PyObject *__pyx_t_1 = NULL;
4284 PyObject *__pyx_t_2 = NULL;
4287 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4288 Py_ssize_t __pyx_t_6;
4289 Py_ssize_t __pyx_t_7;
4290 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4292 int __pyx_lineno = 0;
4293 const char *__pyx_filename = NULL;
4294 int __pyx_clineno = 0;
4295 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4296 __Pyx_RefNannySetupContext(
"set_dense_matrix_float", 0);
4297 __Pyx_TraceCall(
"set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4306 __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4307 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4308 __Pyx_GOTREF(__pyx_t_1);
4309 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4310 __Pyx_GOTREF(__pyx_t_2);
4311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4312 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4313 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4314 __pyx_v_A_num_rows = __pyx_t_3;
4323 __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4324 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4325 __Pyx_GOTREF(__pyx_t_2);
4326 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4327 __Pyx_GOTREF(__pyx_t_1);
4328 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4329 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4331 __pyx_v_A_num_columns = __pyx_t_3;
4340 __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4341 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4342 __Pyx_GOTREF(__pyx_t_1);
4343 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4344 __Pyx_GOTREF(__pyx_t_2);
4345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4346 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4357 __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4358 __pyx_v_A_is_row_major = 1;
4377 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4378 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4379 __Pyx_GOTREF(__pyx_t_2);
4380 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4381 __Pyx_GOTREF(__pyx_t_1);
4382 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4383 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4385 if (likely(__pyx_t_4)) {
4394 __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4395 __pyx_v_A_is_row_major = 0;
4414 __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4416 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4417 __Pyx_GOTREF(__pyx_t_1);
4418 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4420 __PYX_ERR(0, 235, __pyx_L1_error)
4431 __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4432 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4442 __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4443 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4444 __pyx_v_A_data_float_mv_c = __pyx_t_5;
4445 __pyx_t_5.memview = NULL;
4446 __pyx_t_5.data = NULL;
4455 __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4458 __pyx_v_A_data_float = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4477 __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4479 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4480 __pyx_v_A_data_float_mv_f = __pyx_t_8;
4481 __pyx_t_8.memview = NULL;
4482 __pyx_t_8.data = NULL;
4491 __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4494 __pyx_v_A_data_float = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4505 __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4507 __pyx_t_9 =
new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4509 __Pyx_CppExn2PyErr();
4510 __PYX_ERR(0, 262, __pyx_L1_error)
4512 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4523 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4526 __Pyx_XDECREF(__pyx_t_1);
4527 __Pyx_XDECREF(__pyx_t_2);
4528 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4529 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4530 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4533 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4534 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4535 __Pyx_XGIVEREF(__pyx_r);
4536 __Pyx_TraceReturn(__pyx_r, 0);
4537 __Pyx_RefNannyFinishContext();
4550 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4551 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] =
"pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4552 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4553 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4554 PyObject *__pyx_r = 0;
4555 __Pyx_RefNannyDeclarations
4556 __Pyx_RefNannySetupContext(
"set_dense_matrix_double (wrapper)", 0);
4557 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4560 __Pyx_RefNannyFinishContext();
4564 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4567 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4568 __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4569 __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4570 double *__pyx_v_A_data_double;
4571 PyObject *__pyx_r = NULL;
4572 __Pyx_TraceDeclarations
4573 __Pyx_RefNannyDeclarations
4574 PyObject *__pyx_t_1 = NULL;
4575 PyObject *__pyx_t_2 = NULL;
4578 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4579 Py_ssize_t __pyx_t_6;
4580 Py_ssize_t __pyx_t_7;
4581 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4583 int __pyx_lineno = 0;
4584 const char *__pyx_filename = NULL;
4585 int __pyx_clineno = 0;
4586 __Pyx_TraceFrameInit(__pyx_codeobj__6)
4587 __Pyx_RefNannySetupContext(
"set_dense_matrix_double", 0);
4588 __Pyx_TraceCall(
"set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4597 __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4598 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4599 __Pyx_GOTREF(__pyx_t_1);
4600 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4601 __Pyx_GOTREF(__pyx_t_2);
4602 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4603 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4605 __pyx_v_A_num_rows = __pyx_t_3;
4614 __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4615 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4616 __Pyx_GOTREF(__pyx_t_2);
4617 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4618 __Pyx_GOTREF(__pyx_t_1);
4619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4620 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4622 __pyx_v_A_num_columns = __pyx_t_3;
4631 __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4632 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4633 __Pyx_GOTREF(__pyx_t_1);
4634 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4635 __Pyx_GOTREF(__pyx_t_2);
4636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4637 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4648 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4649 __pyx_v_A_is_row_major = 1;
4668 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4669 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4670 __Pyx_GOTREF(__pyx_t_2);
4671 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4672 __Pyx_GOTREF(__pyx_t_1);
4673 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4674 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4676 if (likely(__pyx_t_4)) {
4685 __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4686 __pyx_v_A_is_row_major = 0;
4705 __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4707 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4708 __Pyx_GOTREF(__pyx_t_1);
4709 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4711 __PYX_ERR(0, 291, __pyx_L1_error)
4722 __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4723 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4733 __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4734 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4735 __pyx_v_A_data_double_mv_c = __pyx_t_5;
4736 __pyx_t_5.memview = NULL;
4737 __pyx_t_5.data = NULL;
4746 __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4749 __pyx_v_A_data_double = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4768 __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4770 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4771 __pyx_v_A_data_double_mv_f = __pyx_t_8;
4772 __pyx_t_8.memview = NULL;
4773 __pyx_t_8.data = NULL;
4782 __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4785 __pyx_v_A_data_double = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4796 __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4798 __pyx_t_9 =
new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4800 __Pyx_CppExn2PyErr();
4801 __PYX_ERR(0, 318, __pyx_L1_error)
4803 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4814 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4817 __Pyx_XDECREF(__pyx_t_1);
4818 __Pyx_XDECREF(__pyx_t_2);
4819 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4820 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4821 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4824 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4825 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4826 __Pyx_XGIVEREF(__pyx_r);
4827 __Pyx_TraceReturn(__pyx_r, 0);
4828 __Pyx_RefNannyFinishContext();
4841 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4842 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] =
"pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4843 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4844 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4845 PyObject *__pyx_r = 0;
4846 __Pyx_RefNannyDeclarations
4847 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double (wrapper)", 0);
4848 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4851 __Pyx_RefNannyFinishContext();
4855 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4858 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4859 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4860 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4861 long double *__pyx_v_A_data_long_double;
4862 PyObject *__pyx_r = NULL;
4863 __Pyx_TraceDeclarations
4864 __Pyx_RefNannyDeclarations
4865 PyObject *__pyx_t_1 = NULL;
4866 PyObject *__pyx_t_2 = NULL;
4869 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4870 Py_ssize_t __pyx_t_6;
4871 Py_ssize_t __pyx_t_7;
4872 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4874 int __pyx_lineno = 0;
4875 const char *__pyx_filename = NULL;
4876 int __pyx_clineno = 0;
4877 __Pyx_TraceFrameInit(__pyx_codeobj__7)
4878 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double", 0);
4879 __Pyx_TraceCall(
"set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4888 __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4889 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4890 __Pyx_GOTREF(__pyx_t_1);
4891 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4892 __Pyx_GOTREF(__pyx_t_2);
4893 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4894 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4896 __pyx_v_A_num_rows = __pyx_t_3;
4905 __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4906 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4907 __Pyx_GOTREF(__pyx_t_2);
4908 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4909 __Pyx_GOTREF(__pyx_t_1);
4910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4911 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
4912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4913 __pyx_v_A_num_columns = __pyx_t_3;
4922 __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
4923 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
4924 __Pyx_GOTREF(__pyx_t_1);
4925 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
4926 __Pyx_GOTREF(__pyx_t_2);
4927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4928 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
4929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4939 __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
4940 __pyx_v_A_is_row_major = 1;
4959 __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
4960 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
4961 __Pyx_GOTREF(__pyx_t_2);
4962 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
4963 __Pyx_GOTREF(__pyx_t_1);
4964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4965 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
4966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4967 if (likely(__pyx_t_4)) {
4976 __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
4977 __pyx_v_A_is_row_major = 0;
4996 __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
4998 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
4999 __Pyx_GOTREF(__pyx_t_1);
5000 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5002 __PYX_ERR(0, 347, __pyx_L1_error)
5013 __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
5014 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
5024 __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
5025 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
5026 __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
5027 __pyx_t_5.memview = NULL;
5028 __pyx_t_5.data = NULL;
5037 __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
5040 __pyx_v_A_data_long_double = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
5059 __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
5061 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
5062 __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
5063 __pyx_t_8.memview = NULL;
5064 __pyx_t_8.data = NULL;
5073 __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
5076 __pyx_v_A_data_long_double = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
5087 __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
5089 __pyx_t_9 =
new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
5091 __Pyx_CppExn2PyErr();
5092 __PYX_ERR(0, 374, __pyx_L1_error)
5094 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5105 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5108 __Pyx_XDECREF(__pyx_t_1);
5109 __Pyx_XDECREF(__pyx_t_2);
5110 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5111 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5112 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5115 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
5116 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
5117 __Pyx_XGIVEREF(__pyx_r);
5118 __Pyx_TraceReturn(__pyx_r, 0);
5119 __Pyx_RefNannyFinishContext();
5132 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5133 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float(self, A)\n\n ";
5134 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
5135 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5136 PyObject *__pyx_r = 0;
5137 __Pyx_RefNannyDeclarations
5138 __Pyx_RefNannySetupContext(
"set_csr_matrix_float (wrapper)", 0);
5139 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5142 __Pyx_RefNannyFinishContext();
5146 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5149 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5150 float *__pyx_v_A_data_float;
5151 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5152 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5155 PyObject *__pyx_r = NULL;
5156 __Pyx_TraceDeclarations
5157 __Pyx_RefNannyDeclarations
5158 PyObject *__pyx_t_1 = NULL;
5159 PyObject *__pyx_t_2 = NULL;
5161 PyObject *__pyx_t_4 = NULL;
5162 PyObject *__pyx_t_5 = NULL;
5163 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5164 Py_ssize_t __pyx_t_7;
5165 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5167 int __pyx_lineno = 0;
5168 const char *__pyx_filename = NULL;
5169 int __pyx_clineno = 0;
5170 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5171 __Pyx_RefNannySetupContext(
"set_csr_matrix_float", 0);
5172 __Pyx_TraceCall(
"set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
5181 __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5182 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
5183 __Pyx_GOTREF(__pyx_t_1);
5184 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
5185 __Pyx_GOTREF(__pyx_t_2);
5186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5187 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
5188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5189 __pyx_v_A_num_rows = __pyx_t_3;
5198 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5199 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
5200 __Pyx_GOTREF(__pyx_t_2);
5201 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
5202 __Pyx_GOTREF(__pyx_t_1);
5203 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5204 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
5205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5206 __pyx_v_A_num_columns = __pyx_t_3;
5215 __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5216 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5217 __Pyx_GOTREF(__pyx_t_1);
5218 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5219 __Pyx_GOTREF(__pyx_t_2);
5220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5221 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5222 __Pyx_GOTREF(__pyx_t_1);
5223 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5224 __Pyx_GOTREF(__pyx_t_4);
5225 __Pyx_GIVEREF(__pyx_t_1);
5226 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5228 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5229 __Pyx_GOTREF(__pyx_t_1);
5230 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5231 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5232 __Pyx_GOTREF(__pyx_t_5);
5233 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5235 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5244 __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5245 __Pyx_GIVEREF(__pyx_t_5);
5246 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5247 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5248 __pyx_v_self->A_indices_copy = __pyx_t_5;
5258 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5259 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5260 __Pyx_GOTREF(__pyx_t_5);
5261 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5262 __Pyx_GOTREF(__pyx_t_1);
5263 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5264 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5265 __Pyx_GOTREF(__pyx_t_5);
5266 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5267 __Pyx_GOTREF(__pyx_t_4);
5268 __Pyx_GIVEREF(__pyx_t_5);
5269 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5271 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5272 __Pyx_GOTREF(__pyx_t_5);
5273 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5274 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5275 __Pyx_GOTREF(__pyx_t_2);
5276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5278 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5287 __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5288 __Pyx_GIVEREF(__pyx_t_2);
5289 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5290 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5291 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5301 __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5302 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5303 __pyx_v_A_indices_mv = __pyx_t_6;
5304 __pyx_t_6.memview = NULL;
5305 __pyx_t_6.data = NULL;
5314 __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5315 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5316 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5317 __pyx_t_6.memview = NULL;
5318 __pyx_t_6.data = NULL;
5327 __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5329 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5338 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5340 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5349 __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5350 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5351 __Pyx_GOTREF(__pyx_t_2);
5352 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5354 __pyx_v_A_data_float_mv = __pyx_t_8;
5355 __pyx_t_8.memview = NULL;
5356 __pyx_t_8.data = NULL;
5365 __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5367 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5376 __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5378 __pyx_t_9 =
new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5380 __Pyx_CppExn2PyErr();
5381 __PYX_ERR(0, 420, __pyx_L1_error)
5383 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5394 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5397 __Pyx_XDECREF(__pyx_t_1);
5398 __Pyx_XDECREF(__pyx_t_2);
5399 __Pyx_XDECREF(__pyx_t_4);
5400 __Pyx_XDECREF(__pyx_t_5);
5401 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5402 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5403 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5406 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5407 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5408 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5409 __Pyx_XGIVEREF(__pyx_r);
5410 __Pyx_TraceReturn(__pyx_r, 0);
5411 __Pyx_RefNannyFinishContext();
5424 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5425 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5426 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5427 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5428 PyObject *__pyx_r = 0;
5429 __Pyx_RefNannyDeclarations
5430 __Pyx_RefNannySetupContext(
"set_csr_matrix_double (wrapper)", 0);
5431 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5434 __Pyx_RefNannyFinishContext();
5438 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5441 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5442 double *__pyx_v_A_data_double;
5443 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5444 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5447 PyObject *__pyx_r = NULL;
5448 __Pyx_TraceDeclarations
5449 __Pyx_RefNannyDeclarations
5450 PyObject *__pyx_t_1 = NULL;
5451 PyObject *__pyx_t_2 = NULL;
5453 PyObject *__pyx_t_4 = NULL;
5454 PyObject *__pyx_t_5 = NULL;
5455 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5456 Py_ssize_t __pyx_t_7;
5457 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5459 int __pyx_lineno = 0;
5460 const char *__pyx_filename = NULL;
5461 int __pyx_clineno = 0;
5462 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5463 __Pyx_RefNannySetupContext(
"set_csr_matrix_double", 0);
5464 __Pyx_TraceCall(
"set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5473 __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5474 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5475 __Pyx_GOTREF(__pyx_t_1);
5476 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5477 __Pyx_GOTREF(__pyx_t_2);
5478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5479 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5481 __pyx_v_A_num_rows = __pyx_t_3;
5490 __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5491 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5492 __Pyx_GOTREF(__pyx_t_2);
5493 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5494 __Pyx_GOTREF(__pyx_t_1);
5495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5496 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5498 __pyx_v_A_num_columns = __pyx_t_3;
5507 __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5508 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5509 __Pyx_GOTREF(__pyx_t_1);
5510 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5511 __Pyx_GOTREF(__pyx_t_2);
5512 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5513 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5514 __Pyx_GOTREF(__pyx_t_1);
5515 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5516 __Pyx_GOTREF(__pyx_t_4);
5517 __Pyx_GIVEREF(__pyx_t_1);
5518 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5520 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5521 __Pyx_GOTREF(__pyx_t_1);
5522 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5523 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5524 __Pyx_GOTREF(__pyx_t_5);
5525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5526 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5536 __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5537 __Pyx_GIVEREF(__pyx_t_5);
5538 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5539 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5540 __pyx_v_self->A_indices_copy = __pyx_t_5;
5550 __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5551 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5552 __Pyx_GOTREF(__pyx_t_5);
5553 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5554 __Pyx_GOTREF(__pyx_t_1);
5555 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5556 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5557 __Pyx_GOTREF(__pyx_t_5);
5558 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5559 __Pyx_GOTREF(__pyx_t_4);
5560 __Pyx_GIVEREF(__pyx_t_5);
5561 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5563 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5564 __Pyx_GOTREF(__pyx_t_5);
5565 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5566 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5567 __Pyx_GOTREF(__pyx_t_2);
5568 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5569 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5570 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5579 __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5580 __Pyx_GIVEREF(__pyx_t_2);
5581 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5582 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5583 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5593 __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5594 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5595 __pyx_v_A_indices_mv = __pyx_t_6;
5596 __pyx_t_6.memview = NULL;
5597 __pyx_t_6.data = NULL;
5606 __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5607 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5608 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5609 __pyx_t_6.memview = NULL;
5610 __pyx_t_6.data = NULL;
5619 __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5621 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5630 __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5632 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5641 __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5642 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5643 __Pyx_GOTREF(__pyx_t_2);
5644 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646 __pyx_v_A_data_double_mv = __pyx_t_8;
5647 __pyx_t_8.memview = NULL;
5648 __pyx_t_8.data = NULL;
5657 __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5659 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5668 __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5670 __pyx_t_9 =
new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5672 __Pyx_CppExn2PyErr();
5673 __PYX_ERR(0, 467, __pyx_L1_error)
5675 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5686 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5689 __Pyx_XDECREF(__pyx_t_1);
5690 __Pyx_XDECREF(__pyx_t_2);
5691 __Pyx_XDECREF(__pyx_t_4);
5692 __Pyx_XDECREF(__pyx_t_5);
5693 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5694 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5695 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5698 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5699 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5700 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5701 __Pyx_XGIVEREF(__pyx_r);
5702 __Pyx_TraceReturn(__pyx_r, 0);
5703 __Pyx_RefNannyFinishContext();
5716 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5717 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] =
"pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5718 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5719 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5720 PyObject *__pyx_r = 0;
5721 __Pyx_RefNannyDeclarations
5722 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double (wrapper)", 0);
5723 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5726 __Pyx_RefNannyFinishContext();
5730 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5733 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5734 long double *__pyx_v_A_data_long_double;
5735 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5736 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5739 PyObject *__pyx_r = NULL;
5740 __Pyx_TraceDeclarations
5741 __Pyx_RefNannyDeclarations
5742 PyObject *__pyx_t_1 = NULL;
5743 PyObject *__pyx_t_2 = NULL;
5745 PyObject *__pyx_t_4 = NULL;
5746 PyObject *__pyx_t_5 = NULL;
5747 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5748 Py_ssize_t __pyx_t_7;
5749 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5751 int __pyx_lineno = 0;
5752 const char *__pyx_filename = NULL;
5753 int __pyx_clineno = 0;
5754 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5755 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double", 0);
5756 __Pyx_TraceCall(
"set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5765 __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5766 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5767 __Pyx_GOTREF(__pyx_t_1);
5768 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5769 __Pyx_GOTREF(__pyx_t_2);
5770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5771 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5773 __pyx_v_A_num_rows = __pyx_t_3;
5782 __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5783 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5784 __Pyx_GOTREF(__pyx_t_2);
5785 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5786 __Pyx_GOTREF(__pyx_t_1);
5787 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5788 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5790 __pyx_v_A_num_columns = __pyx_t_3;
5799 __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5800 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5801 __Pyx_GOTREF(__pyx_t_1);
5802 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5803 __Pyx_GOTREF(__pyx_t_2);
5804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5805 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5806 __Pyx_GOTREF(__pyx_t_1);
5807 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5808 __Pyx_GOTREF(__pyx_t_4);
5809 __Pyx_GIVEREF(__pyx_t_1);
5810 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5812 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5813 __Pyx_GOTREF(__pyx_t_1);
5814 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5815 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5816 __Pyx_GOTREF(__pyx_t_5);
5817 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5818 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5819 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5828 __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5829 __Pyx_GIVEREF(__pyx_t_5);
5830 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5831 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5832 __pyx_v_self->A_indices_copy = __pyx_t_5;
5842 __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5843 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5844 __Pyx_GOTREF(__pyx_t_5);
5845 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5846 __Pyx_GOTREF(__pyx_t_1);
5847 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5848 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5849 __Pyx_GOTREF(__pyx_t_5);
5850 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5851 __Pyx_GOTREF(__pyx_t_4);
5852 __Pyx_GIVEREF(__pyx_t_5);
5853 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5855 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5856 __Pyx_GOTREF(__pyx_t_5);
5857 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5858 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5859 __Pyx_GOTREF(__pyx_t_2);
5860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5861 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5862 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5871 __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5872 __Pyx_GIVEREF(__pyx_t_2);
5873 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5874 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5875 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5885 __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5886 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5887 __pyx_v_A_indices_mv = __pyx_t_6;
5888 __pyx_t_6.memview = NULL;
5889 __pyx_t_6.data = NULL;
5898 __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5899 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5900 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5901 __pyx_t_6.memview = NULL;
5902 __pyx_t_6.data = NULL;
5911 __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
5913 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5922 __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
5924 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5933 __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
5934 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_2);
5936 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
5937 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5938 __pyx_v_A_data_long_double_mv = __pyx_t_8;
5939 __pyx_t_8.memview = NULL;
5940 __pyx_t_8.data = NULL;
5949 __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
5951 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
5960 __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
5962 __pyx_t_9 =
new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5964 __Pyx_CppExn2PyErr();
5965 __PYX_ERR(0, 514, __pyx_L1_error)
5967 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5978 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5981 __Pyx_XDECREF(__pyx_t_1);
5982 __Pyx_XDECREF(__pyx_t_2);
5983 __Pyx_XDECREF(__pyx_t_4);
5984 __Pyx_XDECREF(__pyx_t_5);
5985 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5986 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5987 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5990 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
5991 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5992 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5993 __Pyx_XGIVEREF(__pyx_r);
5994 __Pyx_TraceReturn(__pyx_r, 0);
5995 __Pyx_RefNannyFinishContext();
6008 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6009 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float(self, A)\n\n ";
6010 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
6011 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6012 PyObject *__pyx_r = 0;
6013 __Pyx_RefNannyDeclarations
6014 __Pyx_RefNannySetupContext(
"set_csc_matrix_float (wrapper)", 0);
6015 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6018 __Pyx_RefNannyFinishContext();
6022 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6025 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6026 float *__pyx_v_A_data_float;
6027 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6028 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6031 PyObject *__pyx_r = NULL;
6032 __Pyx_TraceDeclarations
6033 __Pyx_RefNannyDeclarations
6034 PyObject *__pyx_t_1 = NULL;
6035 PyObject *__pyx_t_2 = NULL;
6037 PyObject *__pyx_t_4 = NULL;
6038 PyObject *__pyx_t_5 = NULL;
6039 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6040 Py_ssize_t __pyx_t_7;
6041 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6043 int __pyx_lineno = 0;
6044 const char *__pyx_filename = NULL;
6045 int __pyx_clineno = 0;
6046 __Pyx_TraceFrameInit(__pyx_codeobj__11)
6047 __Pyx_RefNannySetupContext(
"set_csc_matrix_float", 0);
6048 __Pyx_TraceCall(
"set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
6057 __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
6058 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
6059 __Pyx_GOTREF(__pyx_t_1);
6060 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
6061 __Pyx_GOTREF(__pyx_t_2);
6062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6063 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
6064 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6065 __pyx_v_A_num_rows = __pyx_t_3;
6074 __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
6075 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
6076 __Pyx_GOTREF(__pyx_t_2);
6077 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
6078 __Pyx_GOTREF(__pyx_t_1);
6079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6080 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
6081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6082 __pyx_v_A_num_columns = __pyx_t_3;
6091 __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
6092 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_2);
6096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6097 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6098 __Pyx_GOTREF(__pyx_t_1);
6099 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
6100 __Pyx_GOTREF(__pyx_t_4);
6101 __Pyx_GIVEREF(__pyx_t_1);
6102 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6104 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6105 __Pyx_GOTREF(__pyx_t_1);
6106 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
6107 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
6108 __Pyx_GOTREF(__pyx_t_5);
6109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6110 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6120 __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6121 __Pyx_GIVEREF(__pyx_t_5);
6122 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6123 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6124 __pyx_v_self->A_indices_copy = __pyx_t_5;
6134 __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6135 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6136 __Pyx_GOTREF(__pyx_t_5);
6137 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
6138 __Pyx_GOTREF(__pyx_t_1);
6139 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6140 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6141 __Pyx_GOTREF(__pyx_t_5);
6142 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
6143 __Pyx_GOTREF(__pyx_t_4);
6144 __Pyx_GIVEREF(__pyx_t_5);
6145 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6147 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6148 __Pyx_GOTREF(__pyx_t_5);
6149 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
6150 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
6151 __Pyx_GOTREF(__pyx_t_2);
6152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6154 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6163 __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
6164 __Pyx_GIVEREF(__pyx_t_2);
6165 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6166 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6167 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6177 __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6178 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
6179 __pyx_v_A_indices_mv = __pyx_t_6;
6180 __pyx_t_6.memview = NULL;
6181 __pyx_t_6.data = NULL;
6190 __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
6191 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
6192 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6193 __pyx_t_6.memview = NULL;
6194 __pyx_t_6.data = NULL;
6203 __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6205 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6214 __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
6216 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6225 __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6226 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6227 __Pyx_GOTREF(__pyx_t_2);
6228 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6229 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6230 __pyx_v_A_data_float_mv = __pyx_t_8;
6231 __pyx_t_8.memview = NULL;
6232 __pyx_t_8.data = NULL;
6241 __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6243 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6252 __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6254 __pyx_t_9 =
new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6256 __Pyx_CppExn2PyErr();
6257 __PYX_ERR(0, 561, __pyx_L1_error)
6259 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6270 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6273 __Pyx_XDECREF(__pyx_t_1);
6274 __Pyx_XDECREF(__pyx_t_2);
6275 __Pyx_XDECREF(__pyx_t_4);
6276 __Pyx_XDECREF(__pyx_t_5);
6277 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6278 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6279 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6282 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6283 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6284 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6285 __Pyx_XGIVEREF(__pyx_r);
6286 __Pyx_TraceReturn(__pyx_r, 0);
6287 __Pyx_RefNannyFinishContext();
6300 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6301 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6302 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6303 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6304 PyObject *__pyx_r = 0;
6305 __Pyx_RefNannyDeclarations
6306 __Pyx_RefNannySetupContext(
"set_csc_matrix_double (wrapper)", 0);
6307 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6310 __Pyx_RefNannyFinishContext();
6314 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6317 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6318 double *__pyx_v_A_data_double;
6319 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6320 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6323 PyObject *__pyx_r = NULL;
6324 __Pyx_TraceDeclarations
6325 __Pyx_RefNannyDeclarations
6326 PyObject *__pyx_t_1 = NULL;
6327 PyObject *__pyx_t_2 = NULL;
6329 PyObject *__pyx_t_4 = NULL;
6330 PyObject *__pyx_t_5 = NULL;
6331 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6332 Py_ssize_t __pyx_t_7;
6333 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6335 int __pyx_lineno = 0;
6336 const char *__pyx_filename = NULL;
6337 int __pyx_clineno = 0;
6338 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6339 __Pyx_RefNannySetupContext(
"set_csc_matrix_double", 0);
6340 __Pyx_TraceCall(
"set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6349 __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6350 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6351 __Pyx_GOTREF(__pyx_t_1);
6352 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6353 __Pyx_GOTREF(__pyx_t_2);
6354 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6355 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6356 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6357 __pyx_v_A_num_rows = __pyx_t_3;
6366 __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6367 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6368 __Pyx_GOTREF(__pyx_t_2);
6369 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6370 __Pyx_GOTREF(__pyx_t_1);
6371 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6372 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6374 __pyx_v_A_num_columns = __pyx_t_3;
6383 __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6384 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6385 __Pyx_GOTREF(__pyx_t_1);
6386 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6387 __Pyx_GOTREF(__pyx_t_2);
6388 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6389 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6390 __Pyx_GOTREF(__pyx_t_1);
6391 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6392 __Pyx_GOTREF(__pyx_t_4);
6393 __Pyx_GIVEREF(__pyx_t_1);
6394 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6396 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6397 __Pyx_GOTREF(__pyx_t_1);
6398 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6399 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6400 __Pyx_GOTREF(__pyx_t_5);
6401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6402 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6403 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6412 __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6413 __Pyx_GIVEREF(__pyx_t_5);
6414 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6415 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6416 __pyx_v_self->A_indices_copy = __pyx_t_5;
6426 __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6427 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6428 __Pyx_GOTREF(__pyx_t_5);
6429 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6430 __Pyx_GOTREF(__pyx_t_1);
6431 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6432 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6433 __Pyx_GOTREF(__pyx_t_5);
6434 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6435 __Pyx_GOTREF(__pyx_t_4);
6436 __Pyx_GIVEREF(__pyx_t_5);
6437 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6439 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6440 __Pyx_GOTREF(__pyx_t_5);
6441 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6442 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6443 __Pyx_GOTREF(__pyx_t_2);
6444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6445 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6446 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6455 __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6456 __Pyx_GIVEREF(__pyx_t_2);
6457 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6458 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6459 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6469 __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6470 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6471 __pyx_v_A_indices_mv = __pyx_t_6;
6472 __pyx_t_6.memview = NULL;
6473 __pyx_t_6.data = NULL;
6482 __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6483 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6484 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6485 __pyx_t_6.memview = NULL;
6486 __pyx_t_6.data = NULL;
6495 __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6497 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6506 __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6508 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6517 __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6518 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6519 __Pyx_GOTREF(__pyx_t_2);
6520 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6522 __pyx_v_A_data_double_mv = __pyx_t_8;
6523 __pyx_t_8.memview = NULL;
6524 __pyx_t_8.data = NULL;
6533 __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6535 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6544 __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6546 __pyx_t_9 =
new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6548 __Pyx_CppExn2PyErr();
6549 __PYX_ERR(0, 608, __pyx_L1_error)
6551 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6562 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6565 __Pyx_XDECREF(__pyx_t_1);
6566 __Pyx_XDECREF(__pyx_t_2);
6567 __Pyx_XDECREF(__pyx_t_4);
6568 __Pyx_XDECREF(__pyx_t_5);
6569 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6570 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6571 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6574 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6575 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6576 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6577 __Pyx_XGIVEREF(__pyx_r);
6578 __Pyx_TraceReturn(__pyx_r, 0);
6579 __Pyx_RefNannyFinishContext();
6592 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6593 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] =
"pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6594 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6595 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6596 PyObject *__pyx_r = 0;
6597 __Pyx_RefNannyDeclarations
6598 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double (wrapper)", 0);
6599 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6602 __Pyx_RefNannyFinishContext();
6606 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6609 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6610 long double *__pyx_v_A_data_long_double;
6611 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6612 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6615 PyObject *__pyx_r = NULL;
6616 __Pyx_TraceDeclarations
6617 __Pyx_RefNannyDeclarations
6618 PyObject *__pyx_t_1 = NULL;
6619 PyObject *__pyx_t_2 = NULL;
6621 PyObject *__pyx_t_4 = NULL;
6622 PyObject *__pyx_t_5 = NULL;
6623 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6624 Py_ssize_t __pyx_t_7;
6625 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6627 int __pyx_lineno = 0;
6628 const char *__pyx_filename = NULL;
6629 int __pyx_clineno = 0;
6630 __Pyx_TraceFrameInit(__pyx_codeobj__13)
6631 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double", 0);
6632 __Pyx_TraceCall(
"set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6641 __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6642 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6643 __Pyx_GOTREF(__pyx_t_1);
6644 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6645 __Pyx_GOTREF(__pyx_t_2);
6646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6647 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6648 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6649 __pyx_v_A_num_rows = __pyx_t_3;
6658 __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6659 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6660 __Pyx_GOTREF(__pyx_t_2);
6661 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6662 __Pyx_GOTREF(__pyx_t_1);
6663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6664 __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1);
if (unlikely((__pyx_t_3 == ((
LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6666 __pyx_v_A_num_columns = __pyx_t_3;
6675 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6676 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6677 __Pyx_GOTREF(__pyx_t_1);
6678 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6679 __Pyx_GOTREF(__pyx_t_2);
6680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6681 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6682 __Pyx_GOTREF(__pyx_t_1);
6683 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6684 __Pyx_GOTREF(__pyx_t_4);
6685 __Pyx_GIVEREF(__pyx_t_1);
6686 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6688 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6689 __Pyx_GOTREF(__pyx_t_1);
6690 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6691 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6692 __Pyx_GOTREF(__pyx_t_5);
6693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6694 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6704 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6705 __Pyx_GIVEREF(__pyx_t_5);
6706 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6707 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6708 __pyx_v_self->A_indices_copy = __pyx_t_5;
6718 __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6719 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6720 __Pyx_GOTREF(__pyx_t_5);
6721 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6722 __Pyx_GOTREF(__pyx_t_1);
6723 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6724 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6725 __Pyx_GOTREF(__pyx_t_5);
6726 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6727 __Pyx_GOTREF(__pyx_t_4);
6728 __Pyx_GIVEREF(__pyx_t_5);
6729 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6731 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_5);
6733 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6734 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6735 __Pyx_GOTREF(__pyx_t_2);
6736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6738 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6747 __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6748 __Pyx_GIVEREF(__pyx_t_2);
6749 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6750 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6751 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6761 __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6762 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6763 __pyx_v_A_indices_mv = __pyx_t_6;
6764 __pyx_t_6.memview = NULL;
6765 __pyx_t_6.data = NULL;
6774 __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6775 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6776 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6777 __pyx_t_6.memview = NULL;
6778 __pyx_t_6.data = NULL;
6787 __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6789 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6798 __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6800 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6809 __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6810 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6811 __Pyx_GOTREF(__pyx_t_2);
6812 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6813 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6814 __pyx_v_A_data_long_double_mv = __pyx_t_8;
6815 __pyx_t_8.memview = NULL;
6816 __pyx_t_8.data = NULL;
6825 __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6827 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6836 __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6838 __pyx_t_9 =
new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6840 __Pyx_CppExn2PyErr();
6841 __PYX_ERR(0, 655, __pyx_L1_error)
6843 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6854 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6857 __Pyx_XDECREF(__pyx_t_1);
6858 __Pyx_XDECREF(__pyx_t_2);
6859 __Pyx_XDECREF(__pyx_t_4);
6860 __Pyx_XDECREF(__pyx_t_5);
6861 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6862 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6863 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6866 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6867 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6868 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6869 __Pyx_XGIVEREF(__pyx_r);
6870 __Pyx_TraceReturn(__pyx_r, 0);
6871 __Pyx_RefNannyFinishContext();
6882 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6883 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] =
"pycMatrix.__reduce_cython__(self)";
6884 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6885 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6886 PyObject *__pyx_r = 0;
6887 __Pyx_RefNannyDeclarations
6888 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6889 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6892 __Pyx_RefNannyFinishContext();
6896 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6897 PyObject *__pyx_r = NULL;
6898 __Pyx_TraceDeclarations
6899 __Pyx_RefNannyDeclarations
6900 PyObject *__pyx_t_1 = NULL;
6901 int __pyx_lineno = 0;
6902 const char *__pyx_filename = NULL;
6903 int __pyx_clineno = 0;
6904 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6905 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6906 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6914 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6915 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6916 __Pyx_GOTREF(__pyx_t_1);
6917 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6919 __PYX_ERR(1, 2, __pyx_L1_error)
6929 __Pyx_XDECREF(__pyx_t_1);
6930 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6932 __Pyx_XGIVEREF(__pyx_r);
6933 __Pyx_TraceReturn(__pyx_r, 0);
6934 __Pyx_RefNannyFinishContext();
6946 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6947 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] =
"pycMatrix.__setstate_cython__(self, __pyx_state)";
6948 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
6949 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6950 PyObject *__pyx_r = 0;
6951 __Pyx_RefNannyDeclarations
6952 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6953 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6956 __Pyx_RefNannyFinishContext();
6960 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6961 PyObject *__pyx_r = NULL;
6962 __Pyx_TraceDeclarations
6963 __Pyx_RefNannyDeclarations
6964 PyObject *__pyx_t_1 = NULL;
6965 int __pyx_lineno = 0;
6966 const char *__pyx_filename = NULL;
6967 int __pyx_clineno = 0;
6968 __Pyx_TraceFrameInit(__pyx_codeobj__16)
6969 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6970 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6977 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6978 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6979 __Pyx_GOTREF(__pyx_t_1);
6980 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6981 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6982 __PYX_ERR(1, 4, __pyx_L1_error)
6993 __Pyx_XDECREF(__pyx_t_1);
6994 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6996 __Pyx_XGIVEREF(__pyx_r);
6997 __Pyx_TraceReturn(__pyx_r, 0);
6998 __Pyx_RefNannyFinishContext();
7011 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7012 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7013 PyObject *__pyx_v_shape = 0;
7014 Py_ssize_t __pyx_v_itemsize;
7015 PyObject *__pyx_v_format = 0;
7016 PyObject *__pyx_v_mode = 0;
7017 int __pyx_v_allocate_buffer;
7018 int __pyx_lineno = 0;
7019 const char *__pyx_filename = NULL;
7020 int __pyx_clineno = 0;
7022 __Pyx_RefNannyDeclarations
7023 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7025 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7026 PyObject* values[5] = {0,0,0,0,0};
7027 values[3] = ((PyObject *)__pyx_n_s_c);
7028 if (unlikely(__pyx_kwds)) {
7030 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7032 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7034 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7036 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7038 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7040 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7043 default:
goto __pyx_L5_argtuple_error;
7045 kw_args = PyDict_Size(__pyx_kwds);
7048 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7049 else goto __pyx_L5_argtuple_error;
7052 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7054 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
7058 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7060 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
7065 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7066 if (value) { values[3] = value; kw_args--; }
7071 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7072 if (value) { values[4] = value; kw_args--; }
7075 if (unlikely(kw_args > 0)) {
7076 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
7079 switch (PyTuple_GET_SIZE(__pyx_args)) {
7080 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7082 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7084 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7085 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7086 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7088 default:
goto __pyx_L5_argtuple_error;
7091 __pyx_v_shape = ((PyObject*)values[0]);
7092 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7093 __pyx_v_format = values[2];
7094 __pyx_v_mode = values[3];
7096 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
7106 __pyx_v_allocate_buffer = ((int)1);
7109 goto __pyx_L4_argument_unpacking_done;
7110 __pyx_L5_argtuple_error:;
7111 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
7113 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7114 __Pyx_RefNannyFinishContext();
7116 __pyx_L4_argument_unpacking_done:;
7117 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
7118 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7119 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
7121 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7136 __Pyx_RefNannyFinishContext();
7140 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
7142 Py_ssize_t __pyx_v_i;
7143 Py_ssize_t __pyx_v_dim;
7144 PyObject **__pyx_v_p;
7147 __Pyx_TraceDeclarations
7148 __Pyx_RefNannyDeclarations
7149 Py_ssize_t __pyx_t_1;
7151 PyObject *__pyx_t_3 = NULL;
7153 PyObject *__pyx_t_5 = NULL;
7154 PyObject *__pyx_t_6 = NULL;
7157 Py_ssize_t __pyx_t_9;
7158 PyObject *__pyx_t_10 = NULL;
7159 Py_ssize_t __pyx_t_11;
7160 int __pyx_lineno = 0;
7161 const char *__pyx_filename = NULL;
7162 int __pyx_clineno = 0;
7163 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7164 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
7165 __Pyx_INCREF(__pyx_v_format);
7174 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
7175 if (unlikely(__pyx_v_shape == Py_None)) {
7176 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
7177 __PYX_ERR(1, 130, __pyx_L1_error)
7179 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
7180 __pyx_v_self->ndim = ((int)__pyx_t_1);
7189 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
7190 __pyx_v_self->itemsize = __pyx_v_itemsize;
7199 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
7200 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7201 if (unlikely(__pyx_t_2)) {
7210 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
7211 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
7212 __Pyx_GOTREF(__pyx_t_3);
7213 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7214 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7215 __PYX_ERR(1, 134, __pyx_L1_error)
7233 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7234 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7235 if (unlikely(__pyx_t_2)) {
7244 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
7245 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
7246 __Pyx_GOTREF(__pyx_t_3);
7247 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7248 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249 __PYX_ERR(1, 137, __pyx_L1_error)
7267 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7268 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7269 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7279 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7280 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
7281 __Pyx_GOTREF(__pyx_t_5);
7283 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7284 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7285 if (likely(__pyx_t_6)) {
7286 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7287 __Pyx_INCREF(__pyx_t_6);
7288 __Pyx_INCREF(
function);
7289 __Pyx_DECREF_SET(__pyx_t_5,
function);
7292 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7293 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7294 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
7295 __Pyx_GOTREF(__pyx_t_3);
7296 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7297 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7316 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7317 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
7318 __pyx_t_3 = __pyx_v_format;
7319 __Pyx_INCREF(__pyx_t_3);
7320 __Pyx_GIVEREF(__pyx_t_3);
7321 __Pyx_GOTREF(__pyx_v_self->_format);
7322 __Pyx_DECREF(__pyx_v_self->_format);
7323 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7333 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
7334 if (unlikely(__pyx_v_self->_format == Py_None)) {
7335 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
7336 __PYX_ERR(1, 142, __pyx_L1_error)
7338 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
7339 __pyx_v_self->format = __pyx_t_7;
7348 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7349 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7358 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
7359 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7368 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7369 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7370 if (unlikely(__pyx_t_4)) {
7379 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
7380 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
7381 __Pyx_GOTREF(__pyx_t_3);
7382 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7383 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7384 __PYX_ERR(1, 149, __pyx_L1_error)
7402 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7404 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7406 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
7407 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7408 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
7410 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
7411 __Pyx_GOTREF(__pyx_t_5);
7413 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
7414 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7415 __pyx_v_dim = __pyx_t_9;
7416 __pyx_v_idx = __pyx_t_8;
7417 __pyx_t_8 = (__pyx_t_8 + 1);
7426 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7427 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7428 if (unlikely(__pyx_t_4)) {
7437 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7438 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
7439 __Pyx_GOTREF(__pyx_t_5);
7440 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7441 __Pyx_GOTREF(__pyx_t_6);
7442 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7443 __Pyx_GOTREF(__pyx_t_10);
7444 __Pyx_GIVEREF(__pyx_t_5);
7445 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7446 __Pyx_GIVEREF(__pyx_t_6);
7447 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7450 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7451 __Pyx_GOTREF(__pyx_t_6);
7452 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7453 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7454 __Pyx_GOTREF(__pyx_t_10);
7455 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7456 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7457 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7458 __PYX_ERR(1, 154, __pyx_L1_error)
7476 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
7477 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7486 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7488 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7497 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7498 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
7508 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7509 __pyx_v_order =
'F';
7518 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7519 __Pyx_INCREF(__pyx_n_u_fortran);
7520 __Pyx_GIVEREF(__pyx_n_u_fortran);
7521 __Pyx_GOTREF(__pyx_v_self->mode);
7522 __Pyx_DECREF(__pyx_v_self->mode);
7523 __pyx_v_self->mode = __pyx_n_u_fortran;
7542 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7543 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
7544 if (likely(__pyx_t_4)) {
7553 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7554 __pyx_v_order =
'C';
7563 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
7564 __Pyx_INCREF(__pyx_n_u_c);
7565 __Pyx_GIVEREF(__pyx_n_u_c);
7566 __Pyx_GOTREF(__pyx_v_self->mode);
7567 __Pyx_DECREF(__pyx_v_self->mode);
7568 __pyx_v_self->mode = __pyx_n_u_c;
7587 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
7589 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
7590 __Pyx_GOTREF(__pyx_t_3);
7591 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
7592 __Pyx_GOTREF(__pyx_t_10);
7593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7594 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7595 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7596 __PYX_ERR(1, 165, __pyx_L1_error)
7607 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
7608 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7617 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7618 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7627 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7628 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
7629 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
7630 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7631 __pyx_v_self->dtype_is_object = __pyx_t_4;
7640 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
7641 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7651 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7652 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
7661 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7662 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7663 if (unlikely(__pyx_t_4)) {
7672 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
7673 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_10);
7675 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7676 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7677 __PYX_ERR(1, 177, __pyx_L1_error)
7695 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7696 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7706 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7707 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7716 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7717 if (unlikely(__pyx_v_itemsize == 0)) {
7718 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7719 __PYX_ERR(1, 181, __pyx_L1_error)
7721 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7722 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7723 __PYX_ERR(1, 181, __pyx_L1_error)
7725 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7726 __pyx_t_9 = __pyx_t_1;
7727 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7728 __pyx_v_i = __pyx_t_11;
7737 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7738 (__pyx_v_p[__pyx_v_i]) = Py_None;
7747 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7781 __Pyx_XDECREF(__pyx_t_3);
7782 __Pyx_XDECREF(__pyx_t_5);
7783 __Pyx_XDECREF(__pyx_t_6);
7784 __Pyx_XDECREF(__pyx_t_10);
7785 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7788 __Pyx_XDECREF(__pyx_v_format);
7789 __Pyx_TraceReturn(Py_None, 0);
7790 __Pyx_RefNannyFinishContext();
7803 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7804 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7806 __Pyx_RefNannyDeclarations
7807 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7808 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7811 __Pyx_RefNannyFinishContext();
7815 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7816 int __pyx_v_bufmode;
7818 __Pyx_TraceDeclarations
7819 __Pyx_RefNannyDeclarations
7822 PyObject *__pyx_t_3 = NULL;
7824 Py_ssize_t __pyx_t_5;
7826 Py_ssize_t *__pyx_t_7;
7827 int __pyx_lineno = 0;
7828 const char *__pyx_filename = NULL;
7829 int __pyx_clineno = 0;
7830 if (__pyx_v_info == NULL) {
7831 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7834 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7835 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7836 __Pyx_GIVEREF(__pyx_v_info->obj);
7837 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7846 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7847 __pyx_v_bufmode = -1;
7856 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7857 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7858 __pyx_t_2 = (__pyx_t_1 != 0);
7868 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7869 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7888 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7889 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7890 __pyx_t_1 = (__pyx_t_2 != 0);
7900 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7901 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7920 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7921 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7922 if (unlikely(__pyx_t_1)) {
7931 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7932 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
7933 __Pyx_GOTREF(__pyx_t_3);
7934 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7935 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7936 __PYX_ERR(1, 193, __pyx_L1_error)
7954 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7955 __pyx_t_4 = __pyx_v_self->data;
7956 __pyx_v_info->buf = __pyx_t_4;
7965 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7966 __pyx_t_5 = __pyx_v_self->len;
7967 __pyx_v_info->len = __pyx_t_5;
7976 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7977 __pyx_t_6 = __pyx_v_self->ndim;
7978 __pyx_v_info->ndim = __pyx_t_6;
7987 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7988 __pyx_t_7 = __pyx_v_self->_shape;
7989 __pyx_v_info->shape = __pyx_t_7;
7998 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7999 __pyx_t_7 = __pyx_v_self->_strides;
8000 __pyx_v_info->strides = __pyx_t_7;
8009 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
8010 __pyx_v_info->suboffsets = NULL;
8019 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
8020 __pyx_t_5 = __pyx_v_self->itemsize;
8021 __pyx_v_info->itemsize = __pyx_t_5;
8030 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
8031 __pyx_v_info->readonly = 0;
8040 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
8041 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8051 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
8052 __pyx_t_4 = __pyx_v_self->format;
8053 __pyx_v_info->format = __pyx_t_4;
8072 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
8074 __pyx_v_info->format = NULL;
8085 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
8086 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8087 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8088 __Pyx_GOTREF(__pyx_v_info->obj);
8089 __Pyx_DECREF(__pyx_v_info->obj);
8090 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8104 __Pyx_XDECREF(__pyx_t_3);
8105 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8107 if (__pyx_v_info->obj != NULL) {
8108 __Pyx_GOTREF(__pyx_v_info->obj);
8109 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8113 if (__pyx_v_info->obj == Py_None) {
8114 __Pyx_GOTREF(__pyx_v_info->obj);
8115 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8118 __Pyx_TraceReturn(Py_None, 0);
8119 __Pyx_RefNannyFinishContext();
8132 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8133 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8134 __Pyx_RefNannyDeclarations
8135 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8136 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8139 __Pyx_RefNannyFinishContext();
8142 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8143 __Pyx_TraceDeclarations
8144 __Pyx_RefNannyDeclarations
8146 int __pyx_lineno = 0;
8147 const char *__pyx_filename = NULL;
8148 int __pyx_clineno = 0;
8149 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8150 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
8159 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
8160 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8170 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
8171 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8190 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
8191 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8201 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
8202 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8212 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
8213 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8231 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8232 free(__pyx_v_self->data);
8251 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
8252 PyObject_Free(__pyx_v_self->_shape);
8265 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8267 __Pyx_TraceReturn(Py_None, 0);
8268 __Pyx_RefNannyFinishContext();
8280 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8281 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8282 PyObject *__pyx_r = 0;
8283 __Pyx_RefNannyDeclarations
8284 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8285 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
8288 __Pyx_RefNannyFinishContext();
8292 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
8293 PyObject *__pyx_r = NULL;
8294 __Pyx_TraceDeclarations
8295 __Pyx_RefNannyDeclarations
8296 PyObject *__pyx_t_1 = NULL;
8297 int __pyx_lineno = 0;
8298 const char *__pyx_filename = NULL;
8299 int __pyx_clineno = 0;
8300 __Pyx_RefNannySetupContext(
"__get__", 0);
8301 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
8310 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
8311 __Pyx_XDECREF(__pyx_r);
8312 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
8313 __Pyx_GOTREF(__pyx_t_1);
8314 __pyx_r = __pyx_t_1;
8328 __Pyx_XDECREF(__pyx_t_1);
8329 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8332 __Pyx_XGIVEREF(__pyx_r);
8333 __Pyx_TraceReturn(__pyx_r, 0);
8334 __Pyx_RefNannyFinishContext();
8346 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
8348 PyObject *__pyx_r = NULL;
8349 __Pyx_TraceDeclarations
8350 __Pyx_RefNannyDeclarations
8351 PyObject *__pyx_t_1 = NULL;
8352 PyObject *__pyx_t_2 = NULL;
8353 PyObject *__pyx_t_3 = NULL;
8354 int __pyx_lineno = 0;
8355 const char *__pyx_filename = NULL;
8356 int __pyx_clineno = 0;
8357 __Pyx_RefNannySetupContext(
"get_memview", 0);
8358 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
8367 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8368 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8377 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
8378 __Pyx_XDECREF(__pyx_r);
8379 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8380 __Pyx_GOTREF(__pyx_t_1);
8381 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8382 __Pyx_GOTREF(__pyx_t_2);
8383 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
8384 __Pyx_GOTREF(__pyx_t_3);
8385 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8386 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8387 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8388 __Pyx_GIVEREF(__pyx_t_1);
8389 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8390 __Pyx_GIVEREF(__pyx_t_2);
8391 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8394 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8395 __Pyx_GOTREF(__pyx_t_2);
8396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8397 __pyx_r = __pyx_t_2;
8411 __Pyx_XDECREF(__pyx_t_1);
8412 __Pyx_XDECREF(__pyx_t_2);
8413 __Pyx_XDECREF(__pyx_t_3);
8414 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8417 __Pyx_XGIVEREF(__pyx_r);
8418 __Pyx_TraceReturn(__pyx_r, 0);
8419 __Pyx_RefNannyFinishContext();
8432 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
8433 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8435 __Pyx_RefNannyDeclarations
8436 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
8437 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
8440 __Pyx_RefNannyFinishContext();
8444 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
8446 __Pyx_TraceDeclarations
8447 __Pyx_RefNannyDeclarations
8448 int __pyx_lineno = 0;
8449 const char *__pyx_filename = NULL;
8450 int __pyx_clineno = 0;
8451 __Pyx_RefNannySetupContext(
"__len__", 0);
8452 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
8461 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
8462 __pyx_r = (__pyx_v_self->_shape[0]);
8475 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8478 __Pyx_TraceReturn(Py_None, 0);
8479 __Pyx_RefNannyFinishContext();
8492 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
8493 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8494 PyObject *__pyx_r = 0;
8495 __Pyx_RefNannyDeclarations
8496 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
8497 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8500 __Pyx_RefNannyFinishContext();
8504 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8505 PyObject *__pyx_r = NULL;
8506 __Pyx_TraceDeclarations
8507 __Pyx_RefNannyDeclarations
8508 PyObject *__pyx_t_1 = NULL;
8509 PyObject *__pyx_t_2 = NULL;
8510 int __pyx_lineno = 0;
8511 const char *__pyx_filename = NULL;
8512 int __pyx_clineno = 0;
8513 __Pyx_RefNannySetupContext(
"__getattr__", 0);
8514 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
8523 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
8524 __Pyx_XDECREF(__pyx_r);
8525 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
8526 __Pyx_GOTREF(__pyx_t_1);
8527 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
8528 __Pyx_GOTREF(__pyx_t_2);
8529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8530 __pyx_r = __pyx_t_2;
8544 __Pyx_XDECREF(__pyx_t_1);
8545 __Pyx_XDECREF(__pyx_t_2);
8546 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8549 __Pyx_XGIVEREF(__pyx_r);
8550 __Pyx_TraceReturn(__pyx_r, 0);
8551 __Pyx_RefNannyFinishContext();
8564 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
8565 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8566 PyObject *__pyx_r = 0;
8567 __Pyx_RefNannyDeclarations
8568 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8569 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8572 __Pyx_RefNannyFinishContext();
8576 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8577 PyObject *__pyx_r = NULL;
8578 __Pyx_TraceDeclarations
8579 __Pyx_RefNannyDeclarations
8580 PyObject *__pyx_t_1 = NULL;
8581 PyObject *__pyx_t_2 = NULL;
8582 int __pyx_lineno = 0;
8583 const char *__pyx_filename = NULL;
8584 int __pyx_clineno = 0;
8585 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8586 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
8595 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
8596 __Pyx_XDECREF(__pyx_r);
8597 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
8598 __Pyx_GOTREF(__pyx_t_1);
8599 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
8600 __Pyx_GOTREF(__pyx_t_2);
8601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8602 __pyx_r = __pyx_t_2;
8616 __Pyx_XDECREF(__pyx_t_1);
8617 __Pyx_XDECREF(__pyx_t_2);
8618 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8621 __Pyx_XGIVEREF(__pyx_r);
8622 __Pyx_TraceReturn(__pyx_r, 0);
8623 __Pyx_RefNannyFinishContext();
8636 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
8637 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8639 __Pyx_RefNannyDeclarations
8640 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8641 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8644 __Pyx_RefNannyFinishContext();
8648 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8650 __Pyx_TraceDeclarations
8651 __Pyx_RefNannyDeclarations
8652 PyObject *__pyx_t_1 = NULL;
8653 int __pyx_lineno = 0;
8654 const char *__pyx_filename = NULL;
8655 int __pyx_clineno = 0;
8656 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8657 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
8666 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
8667 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
8668 __Pyx_GOTREF(__pyx_t_1);
8669 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
8670 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8684 __Pyx_XDECREF(__pyx_t_1);
8685 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8688 __Pyx_TraceReturn(Py_None, 0);
8689 __Pyx_RefNannyFinishContext();
8700 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8701 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8702 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8703 PyObject *__pyx_r = 0;
8704 __Pyx_RefNannyDeclarations
8705 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8706 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8709 __Pyx_RefNannyFinishContext();
8713 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8714 PyObject *__pyx_r = NULL;
8715 __Pyx_TraceDeclarations
8716 __Pyx_RefNannyDeclarations
8717 PyObject *__pyx_t_1 = NULL;
8718 int __pyx_lineno = 0;
8719 const char *__pyx_filename = NULL;
8720 int __pyx_clineno = 0;
8721 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8722 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8730 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8731 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_1);
8733 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8735 __PYX_ERR(1, 2, __pyx_L1_error)
8745 __Pyx_XDECREF(__pyx_t_1);
8746 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8748 __Pyx_XGIVEREF(__pyx_r);
8749 __Pyx_TraceReturn(__pyx_r, 0);
8750 __Pyx_RefNannyFinishContext();
8762 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8763 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8764 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8765 PyObject *__pyx_r = 0;
8766 __Pyx_RefNannyDeclarations
8767 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8768 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8771 __Pyx_RefNannyFinishContext();
8775 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8776 PyObject *__pyx_r = NULL;
8777 __Pyx_TraceDeclarations
8778 __Pyx_RefNannyDeclarations
8779 PyObject *__pyx_t_1 = NULL;
8780 int __pyx_lineno = 0;
8781 const char *__pyx_filename = NULL;
8782 int __pyx_clineno = 0;
8783 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8784 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8791 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8792 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8793 __Pyx_GOTREF(__pyx_t_1);
8794 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8796 __PYX_ERR(1, 4, __pyx_L1_error)
8807 __Pyx_XDECREF(__pyx_t_1);
8808 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8810 __Pyx_XGIVEREF(__pyx_r);
8811 __Pyx_TraceReturn(__pyx_r, 0);
8812 __Pyx_RefNannyFinishContext();
8824 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8825 struct __pyx_array_obj *__pyx_v_result = 0;
8826 struct __pyx_array_obj *__pyx_r = NULL;
8827 __Pyx_TraceDeclarations
8828 __Pyx_RefNannyDeclarations
8830 PyObject *__pyx_t_2 = NULL;
8831 PyObject *__pyx_t_3 = NULL;
8832 PyObject *__pyx_t_4 = NULL;
8833 PyObject *__pyx_t_5 = NULL;
8834 int __pyx_lineno = 0;
8835 const char *__pyx_filename = NULL;
8836 int __pyx_clineno = 0;
8837 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8838 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8847 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8848 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8858 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8859 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8860 __Pyx_GOTREF(__pyx_t_2);
8861 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8862 __Pyx_GOTREF(__pyx_t_3);
8863 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8864 __Pyx_GOTREF(__pyx_t_4);
8865 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8866 __Pyx_GOTREF(__pyx_t_5);
8867 __Pyx_INCREF(__pyx_v_shape);
8868 __Pyx_GIVEREF(__pyx_v_shape);
8869 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8870 __Pyx_GIVEREF(__pyx_t_2);
8871 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8872 __Pyx_GIVEREF(__pyx_t_3);
8873 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8874 __Pyx_GIVEREF(__pyx_t_4);
8875 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8879 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8880 __Pyx_GOTREF(__pyx_t_4);
8881 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8882 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8902 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8904 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8905 __Pyx_GOTREF(__pyx_t_4);
8906 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8907 __Pyx_GOTREF(__pyx_t_5);
8908 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8909 __Pyx_GOTREF(__pyx_t_3);
8910 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
8911 __Pyx_GOTREF(__pyx_t_2);
8912 __Pyx_INCREF(__pyx_v_shape);
8913 __Pyx_GIVEREF(__pyx_v_shape);
8914 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8915 __Pyx_GIVEREF(__pyx_t_4);
8916 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8917 __Pyx_GIVEREF(__pyx_t_5);
8918 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8919 __Pyx_GIVEREF(__pyx_t_3);
8920 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8932 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8933 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
8934 __Pyx_GOTREF(__pyx_t_3);
8935 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
8944 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8945 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8946 __Pyx_GOTREF(__pyx_t_5);
8947 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8948 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8949 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
8959 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
8960 __pyx_v_result->data = __pyx_v_buf;
8971 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
8972 __Pyx_XDECREF(((PyObject *)__pyx_r));
8973 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8974 __pyx_r = __pyx_v_result;
8987 __Pyx_XDECREF(__pyx_t_2);
8988 __Pyx_XDECREF(__pyx_t_3);
8989 __Pyx_XDECREF(__pyx_t_4);
8990 __Pyx_XDECREF(__pyx_t_5);
8991 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8994 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8995 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8996 __Pyx_TraceReturn(__pyx_r, 0);
8997 __Pyx_RefNannyFinishContext();
9010 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9011 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9012 PyObject *__pyx_v_name = 0;
9013 int __pyx_lineno = 0;
9014 const char *__pyx_filename = NULL;
9015 int __pyx_clineno = 0;
9017 __Pyx_RefNannyDeclarations
9018 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9020 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9021 PyObject* values[1] = {0};
9022 if (unlikely(__pyx_kwds)) {
9024 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9026 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9029 default:
goto __pyx_L5_argtuple_error;
9031 kw_args = PyDict_Size(__pyx_kwds);
9034 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9035 else goto __pyx_L5_argtuple_error;
9037 if (unlikely(kw_args > 0)) {
9038 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
9040 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9041 goto __pyx_L5_argtuple_error;
9043 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9045 __pyx_v_name = values[0];
9047 goto __pyx_L4_argument_unpacking_done;
9048 __pyx_L5_argtuple_error:;
9049 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
9051 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9052 __Pyx_RefNannyFinishContext();
9054 __pyx_L4_argument_unpacking_done:;
9055 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9058 __Pyx_RefNannyFinishContext();
9062 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9064 __Pyx_TraceDeclarations
9065 __Pyx_RefNannyDeclarations
9066 int __pyx_lineno = 0;
9067 const char *__pyx_filename = NULL;
9068 int __pyx_clineno = 0;
9069 __Pyx_RefNannySetupContext(
"__init__", 0);
9070 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
9079 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
9080 __Pyx_INCREF(__pyx_v_name);
9081 __Pyx_GIVEREF(__pyx_v_name);
9082 __Pyx_GOTREF(__pyx_v_self->name);
9083 __Pyx_DECREF(__pyx_v_self->name);
9084 __pyx_v_self->name = __pyx_v_name;
9098 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9101 __Pyx_TraceReturn(Py_None, 0);
9102 __Pyx_RefNannyFinishContext();
9115 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9116 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9117 PyObject *__pyx_r = 0;
9118 __Pyx_RefNannyDeclarations
9119 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9120 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9123 __Pyx_RefNannyFinishContext();
9127 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9128 PyObject *__pyx_r = NULL;
9129 __Pyx_TraceDeclarations
9130 __Pyx_RefNannyDeclarations
9131 int __pyx_lineno = 0;
9132 const char *__pyx_filename = NULL;
9133 int __pyx_clineno = 0;
9134 __Pyx_RefNannySetupContext(
"__repr__", 0);
9135 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
9144 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
9145 __Pyx_XDECREF(__pyx_r);
9146 __Pyx_INCREF(__pyx_v_self->name);
9147 __pyx_r = __pyx_v_self->name;
9160 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9163 __Pyx_XGIVEREF(__pyx_r);
9164 __Pyx_TraceReturn(__pyx_r, 0);
9165 __Pyx_RefNannyFinishContext();
9176 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9177 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9178 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9179 PyObject *__pyx_r = 0;
9180 __Pyx_RefNannyDeclarations
9181 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9182 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9185 __Pyx_RefNannyFinishContext();
9189 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9190 PyObject *__pyx_v_state = 0;
9191 PyObject *__pyx_v__dict = 0;
9192 int __pyx_v_use_setstate;
9193 PyObject *__pyx_r = NULL;
9194 __Pyx_TraceDeclarations
9195 __Pyx_RefNannyDeclarations
9196 PyObject *__pyx_t_1 = NULL;
9199 PyObject *__pyx_t_4 = NULL;
9200 PyObject *__pyx_t_5 = NULL;
9201 int __pyx_lineno = 0;
9202 const char *__pyx_filename = NULL;
9203 int __pyx_clineno = 0;
9204 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9205 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9214 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
9215 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9216 __Pyx_GOTREF(__pyx_t_1);
9217 __Pyx_INCREF(__pyx_v_self->name);
9218 __Pyx_GIVEREF(__pyx_v_self->name);
9219 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9220 __pyx_v_state = ((PyObject*)__pyx_t_1);
9230 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9231 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9232 __Pyx_GOTREF(__pyx_t_1);
9233 __pyx_v__dict = __pyx_t_1;
9243 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9244 __pyx_t_2 = (__pyx_v__dict != Py_None);
9245 __pyx_t_3 = (__pyx_t_2 != 0);
9255 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9256 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9257 __Pyx_GOTREF(__pyx_t_1);
9258 __Pyx_INCREF(__pyx_v__dict);
9259 __Pyx_GIVEREF(__pyx_v__dict);
9260 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9261 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9262 __Pyx_GOTREF(__pyx_t_4);
9263 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9264 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9274 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9275 __pyx_v_use_setstate = 1;
9294 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9296 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9297 __pyx_v_use_setstate = __pyx_t_3;
9308 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9309 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9319 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9320 __Pyx_XDECREF(__pyx_r);
9321 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9322 __Pyx_GOTREF(__pyx_t_4);
9323 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9324 __Pyx_GOTREF(__pyx_t_1);
9325 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9326 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9327 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9328 __Pyx_INCREF(__pyx_int_184977713);
9329 __Pyx_GIVEREF(__pyx_int_184977713);
9330 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9331 __Pyx_INCREF(Py_None);
9332 __Pyx_GIVEREF(Py_None);
9333 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9334 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9335 __Pyx_GOTREF(__pyx_t_5);
9336 __Pyx_GIVEREF(__pyx_t_4);
9337 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9338 __Pyx_GIVEREF(__pyx_t_1);
9339 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9340 __Pyx_INCREF(__pyx_v_state);
9341 __Pyx_GIVEREF(__pyx_v_state);
9342 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9345 __pyx_r = __pyx_t_5;
9365 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9367 __Pyx_XDECREF(__pyx_r);
9368 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9369 __Pyx_GOTREF(__pyx_t_5);
9370 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9371 __Pyx_GOTREF(__pyx_t_1);
9372 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9373 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9374 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9375 __Pyx_INCREF(__pyx_int_184977713);
9376 __Pyx_GIVEREF(__pyx_int_184977713);
9377 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9378 __Pyx_INCREF(__pyx_v_state);
9379 __Pyx_GIVEREF(__pyx_v_state);
9380 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9381 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9382 __Pyx_GOTREF(__pyx_t_4);
9383 __Pyx_GIVEREF(__pyx_t_5);
9384 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9385 __Pyx_GIVEREF(__pyx_t_1);
9386 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9389 __pyx_r = __pyx_t_4;
9402 __Pyx_XDECREF(__pyx_t_1);
9403 __Pyx_XDECREF(__pyx_t_4);
9404 __Pyx_XDECREF(__pyx_t_5);
9405 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9408 __Pyx_XDECREF(__pyx_v_state);
9409 __Pyx_XDECREF(__pyx_v__dict);
9410 __Pyx_XGIVEREF(__pyx_r);
9411 __Pyx_TraceReturn(__pyx_r, 0);
9412 __Pyx_RefNannyFinishContext();
9424 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9425 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9426 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9427 PyObject *__pyx_r = 0;
9428 __Pyx_RefNannyDeclarations
9429 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9430 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9433 __Pyx_RefNannyFinishContext();
9437 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9438 PyObject *__pyx_r = NULL;
9439 __Pyx_TraceDeclarations
9440 __Pyx_RefNannyDeclarations
9441 PyObject *__pyx_t_1 = NULL;
9442 int __pyx_lineno = 0;
9443 const char *__pyx_filename = NULL;
9444 int __pyx_clineno = 0;
9445 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9446 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9453 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9454 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9455 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9456 __Pyx_GOTREF(__pyx_t_1);
9457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9467 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9470 __Pyx_XDECREF(__pyx_t_1);
9471 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9474 __Pyx_XGIVEREF(__pyx_r);
9475 __Pyx_TraceReturn(__pyx_r, 0);
9476 __Pyx_RefNannyFinishContext();
9488 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
9489 Py_intptr_t __pyx_v_aligned_p;
9490 size_t __pyx_v_offset;
9492 __Pyx_TraceDeclarations
9494 int __pyx_lineno = 0;
9495 const char *__pyx_filename = NULL;
9496 int __pyx_clineno = 0;
9497 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
9506 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
9507 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9516 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9525 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9526 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9536 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
9537 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9555 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
9556 __pyx_r = ((
void *)__pyx_v_aligned_p);
9569 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9572 __Pyx_TraceReturn(Py_None, 1);
9585 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9586 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9587 PyObject *__pyx_v_obj = 0;
9589 int __pyx_v_dtype_is_object;
9590 int __pyx_lineno = 0;
9591 const char *__pyx_filename = NULL;
9592 int __pyx_clineno = 0;
9594 __Pyx_RefNannyDeclarations
9595 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9597 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9598 PyObject* values[3] = {0,0,0};
9599 if (unlikely(__pyx_kwds)) {
9601 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9603 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9605 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9607 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9610 default:
goto __pyx_L5_argtuple_error;
9612 kw_args = PyDict_Size(__pyx_kwds);
9615 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9616 else goto __pyx_L5_argtuple_error;
9619 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9621 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
9626 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9627 if (value) { values[2] = value; kw_args--; }
9630 if (unlikely(kw_args > 0)) {
9631 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
9634 switch (PyTuple_GET_SIZE(__pyx_args)) {
9635 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9637 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9638 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9640 default:
goto __pyx_L5_argtuple_error;
9643 __pyx_v_obj = values[0];
9644 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9646 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9648 __pyx_v_dtype_is_object = ((int)0);
9651 goto __pyx_L4_argument_unpacking_done;
9652 __pyx_L5_argtuple_error:;
9653 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
9655 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9656 __Pyx_RefNannyFinishContext();
9658 __pyx_L4_argument_unpacking_done:;
9659 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9662 __Pyx_RefNannyFinishContext();
9666 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
9668 __Pyx_TraceDeclarations
9669 __Pyx_RefNannyDeclarations
9674 int __pyx_lineno = 0;
9675 const char *__pyx_filename = NULL;
9676 int __pyx_clineno = 0;
9677 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9678 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
9687 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9688 __Pyx_INCREF(__pyx_v_obj);
9689 __Pyx_GIVEREF(__pyx_v_obj);
9690 __Pyx_GOTREF(__pyx_v_self->obj);
9691 __Pyx_DECREF(__pyx_v_self->obj);
9692 __pyx_v_self->obj = __pyx_v_obj;
9701 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9702 __pyx_v_self->flags = __pyx_v_flags;
9711 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9712 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9713 __pyx_t_3 = (__pyx_t_2 != 0);
9716 __pyx_t_1 = __pyx_t_3;
9717 goto __pyx_L4_bool_binop_done;
9719 __pyx_t_3 = (__pyx_v_obj != Py_None);
9720 __pyx_t_2 = (__pyx_t_3 != 0);
9721 __pyx_t_1 = __pyx_t_2;
9722 __pyx_L4_bool_binop_done:;
9732 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9733 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9742 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9743 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9753 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9754 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9763 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9791 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9792 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9802 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9803 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9813 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9814 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9823 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9824 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9842 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9843 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9853 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9854 __pyx_v_self->lock = PyThread_allocate_lock();
9863 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9864 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9865 if (unlikely(__pyx_t_1)) {
9874 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9875 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
9911 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
9912 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9922 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9923 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
9926 __pyx_t_1 = __pyx_t_2;
9927 goto __pyx_L12_bool_binop_done;
9929 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
9930 __pyx_t_1 = __pyx_t_2;
9931 __pyx_L12_bool_binop_done:;
9932 __pyx_v_self->dtype_is_object = __pyx_t_1;
9951 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9953 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9964 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9965 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9974 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
9975 __pyx_v_self->typeinfo = NULL;
9989 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9992 __Pyx_TraceReturn(Py_None, 0);
9993 __Pyx_RefNannyFinishContext();
10006 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10007 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10008 __Pyx_RefNannyDeclarations
10009 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10010 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10013 __Pyx_RefNannyFinishContext();
10016 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10018 __Pyx_TraceDeclarations
10019 __Pyx_RefNannyDeclarations
10025 PyThread_type_lock __pyx_t_6;
10026 PyThread_type_lock __pyx_t_7;
10027 int __pyx_lineno = 0;
10028 const char *__pyx_filename = NULL;
10029 int __pyx_clineno = 0;
10030 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10031 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
10040 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
10041 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10042 __pyx_t_2 = (__pyx_t_1 != 0);
10052 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
10053 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10072 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
10073 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10083 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
10084 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10093 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
10094 Py_DECREF(Py_None);
10113 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
10114 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10124 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
10125 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10126 __pyx_t_4 = __pyx_t_3;
10127 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10128 __pyx_v_i = __pyx_t_5;
10137 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
10138 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10148 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
10149 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10158 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
10159 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10169 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
10170 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10171 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10180 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
10181 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10182 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10200 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
10201 goto __pyx_L6_break;
10221 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
10222 PyThread_free_lock(__pyx_v_self->lock);
10246 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10248 __Pyx_TraceReturn(Py_None, 0);
10249 __Pyx_RefNannyFinishContext();
10260 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10261 Py_ssize_t __pyx_v_dim;
10262 char *__pyx_v_itemp;
10263 PyObject *__pyx_v_idx = NULL;
10265 __Pyx_TraceDeclarations
10266 __Pyx_RefNannyDeclarations
10267 Py_ssize_t __pyx_t_1;
10268 PyObject *__pyx_t_2 = NULL;
10269 Py_ssize_t __pyx_t_3;
10270 PyObject *(*__pyx_t_4)(PyObject *);
10271 PyObject *__pyx_t_5 = NULL;
10272 Py_ssize_t __pyx_t_6;
10274 int __pyx_lineno = 0;
10275 const char *__pyx_filename = NULL;
10276 int __pyx_clineno = 0;
10277 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10278 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
10287 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10288 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10297 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10299 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10300 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10303 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
10304 __Pyx_GOTREF(__pyx_t_2);
10305 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
10308 if (likely(!__pyx_t_4)) {
10309 if (likely(PyList_CheckExact(__pyx_t_2))) {
10310 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10311 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10312 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10314 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10315 __Pyx_GOTREF(__pyx_t_5);
10318 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10319 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10320 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10322 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10323 __Pyx_GOTREF(__pyx_t_5);
10327 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10328 if (unlikely(!__pyx_t_5)) {
10329 PyObject* exc_type = PyErr_Occurred();
10331 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10332 else __PYX_ERR(1, 399, __pyx_L1_error)
10336 __Pyx_GOTREF(__pyx_t_5);
10338 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10340 __pyx_v_dim = __pyx_t_1;
10341 __pyx_t_1 = (__pyx_t_1 + 1);
10350 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10351 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
10352 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
10353 __pyx_v_itemp = __pyx_t_7;
10362 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10373 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
10374 __pyx_r = __pyx_v_itemp;
10387 __Pyx_XDECREF(__pyx_t_2);
10388 __Pyx_XDECREF(__pyx_t_5);
10389 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10392 __Pyx_XDECREF(__pyx_v_idx);
10393 __Pyx_TraceReturn(Py_None, 0);
10394 __Pyx_RefNannyFinishContext();
10407 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10408 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10409 PyObject *__pyx_r = 0;
10410 __Pyx_RefNannyDeclarations
10411 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10412 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10415 __Pyx_RefNannyFinishContext();
10419 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10420 PyObject *__pyx_v_have_slices = NULL;
10421 PyObject *__pyx_v_indices = NULL;
10422 char *__pyx_v_itemp;
10423 PyObject *__pyx_r = NULL;
10424 __Pyx_TraceDeclarations
10425 __Pyx_RefNannyDeclarations
10428 PyObject *__pyx_t_3 = NULL;
10429 PyObject *__pyx_t_4 = NULL;
10430 PyObject *__pyx_t_5 = NULL;
10432 int __pyx_lineno = 0;
10433 const char *__pyx_filename = NULL;
10434 int __pyx_clineno = 0;
10435 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10436 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
10445 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
10446 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10447 __pyx_t_2 = (__pyx_t_1 != 0);
10457 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10458 __Pyx_XDECREF(__pyx_r);
10459 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10460 __pyx_r = ((PyObject *)__pyx_v_self);
10479 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
10480 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
10481 __Pyx_GOTREF(__pyx_t_3);
10482 if (likely(__pyx_t_3 != Py_None)) {
10483 PyObject* sequence = __pyx_t_3;
10484 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10485 if (unlikely(size != 2)) {
10486 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10487 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10488 __PYX_ERR(1, 409, __pyx_L1_error)
10490 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10491 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10492 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10493 __Pyx_INCREF(__pyx_t_4);
10494 __Pyx_INCREF(__pyx_t_5);
10496 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
10497 __Pyx_GOTREF(__pyx_t_4);
10498 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
10499 __Pyx_GOTREF(__pyx_t_5);
10501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10503 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
10505 __pyx_v_have_slices = __pyx_t_4;
10507 __pyx_v_indices = __pyx_t_5;
10517 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
10518 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
10528 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10529 __Pyx_XDECREF(__pyx_r);
10530 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
10531 __Pyx_GOTREF(__pyx_t_3);
10532 __pyx_r = __pyx_t_3;
10552 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
10554 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
10555 __pyx_v_itemp = __pyx_t_6;
10564 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
10565 __Pyx_XDECREF(__pyx_r);
10566 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
10567 __Pyx_GOTREF(__pyx_t_3);
10568 __pyx_r = __pyx_t_3;
10583 __Pyx_XDECREF(__pyx_t_3);
10584 __Pyx_XDECREF(__pyx_t_4);
10585 __Pyx_XDECREF(__pyx_t_5);
10586 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10589 __Pyx_XDECREF(__pyx_v_have_slices);
10590 __Pyx_XDECREF(__pyx_v_indices);
10591 __Pyx_XGIVEREF(__pyx_r);
10592 __Pyx_TraceReturn(__pyx_r, 0);
10593 __Pyx_RefNannyFinishContext();
10606 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
10607 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10609 __Pyx_RefNannyDeclarations
10610 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10611 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10614 __Pyx_RefNannyFinishContext();
10618 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10619 PyObject *__pyx_v_have_slices = NULL;
10620 PyObject *__pyx_v_obj = NULL;
10622 __Pyx_TraceDeclarations
10623 __Pyx_RefNannyDeclarations
10625 PyObject *__pyx_t_2 = NULL;
10626 PyObject *__pyx_t_3 = NULL;
10627 PyObject *__pyx_t_4 = NULL;
10628 int __pyx_lineno = 0;
10629 const char *__pyx_filename = NULL;
10630 int __pyx_clineno = 0;
10631 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10632 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
10633 __Pyx_INCREF(__pyx_v_index);
10642 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
10643 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10644 if (unlikely(__pyx_t_1)) {
10653 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10654 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10655 __Pyx_GOTREF(__pyx_t_2);
10656 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10657 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10658 __PYX_ERR(1, 420, __pyx_L1_error)
10676 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10677 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
10678 __Pyx_GOTREF(__pyx_t_2);
10679 if (likely(__pyx_t_2 != Py_None)) {
10680 PyObject* sequence = __pyx_t_2;
10681 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10682 if (unlikely(size != 2)) {
10683 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10684 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10685 __PYX_ERR(1, 422, __pyx_L1_error)
10687 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10688 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10689 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10690 __Pyx_INCREF(__pyx_t_3);
10691 __Pyx_INCREF(__pyx_t_4);
10693 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10694 __Pyx_GOTREF(__pyx_t_3);
10695 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10696 __Pyx_GOTREF(__pyx_t_4);
10698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10700 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10702 __pyx_v_have_slices = __pyx_t_3;
10704 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10714 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10715 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10725 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10726 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10727 __Pyx_GOTREF(__pyx_t_2);
10728 __pyx_v_obj = __pyx_t_2;
10738 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10739 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10749 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10750 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10751 __Pyx_GOTREF(__pyx_t_2);
10752 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10753 __Pyx_GOTREF(__pyx_t_4);
10754 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10755 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10774 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10776 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10777 __Pyx_GOTREF(__pyx_t_4);
10778 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10779 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10780 __Pyx_GOTREF(__pyx_t_2);
10781 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10803 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10805 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10806 __Pyx_GOTREF(__pyx_t_2);
10807 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10823 __Pyx_XDECREF(__pyx_t_2);
10824 __Pyx_XDECREF(__pyx_t_3);
10825 __Pyx_XDECREF(__pyx_t_4);
10826 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10829 __Pyx_XDECREF(__pyx_v_have_slices);
10830 __Pyx_XDECREF(__pyx_v_obj);
10831 __Pyx_XDECREF(__pyx_v_index);
10832 __Pyx_TraceReturn(Py_None, 0);
10833 __Pyx_RefNannyFinishContext();
10845 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10846 PyObject *__pyx_r = NULL;
10847 __Pyx_TraceDeclarations
10848 __Pyx_RefNannyDeclarations
10851 PyObject *__pyx_t_3 = NULL;
10852 PyObject *__pyx_t_4 = NULL;
10853 PyObject *__pyx_t_5 = NULL;
10854 PyObject *__pyx_t_6 = NULL;
10855 PyObject *__pyx_t_7 = NULL;
10856 PyObject *__pyx_t_8 = NULL;
10858 int __pyx_lineno = 0;
10859 const char *__pyx_filename = NULL;
10860 int __pyx_clineno = 0;
10861 __Pyx_RefNannySetupContext(
"is_slice", 0);
10862 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10863 __Pyx_INCREF(__pyx_v_obj);
10872 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10873 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10874 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10884 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10886 __Pyx_PyThreadState_declare
10887 __Pyx_PyThreadState_assign
10888 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10889 __Pyx_XGOTREF(__pyx_t_3);
10890 __Pyx_XGOTREF(__pyx_t_4);
10891 __Pyx_XGOTREF(__pyx_t_5);
10901 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10902 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10903 __Pyx_GOTREF(__pyx_t_6);
10912 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
10913 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
10914 __Pyx_GOTREF(__pyx_t_7);
10923 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10924 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
10925 __Pyx_GOTREF(__pyx_t_8);
10926 __Pyx_INCREF(__pyx_v_obj);
10927 __Pyx_GIVEREF(__pyx_v_obj);
10928 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10929 __Pyx_GIVEREF(__pyx_t_6);
10930 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10931 __Pyx_GIVEREF(__pyx_t_7);
10932 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10935 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
10936 __Pyx_GOTREF(__pyx_t_7);
10937 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10938 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10949 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10950 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10951 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10952 goto __pyx_L9_try_end;
10954 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10955 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10956 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10965 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
10966 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10968 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10969 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
10970 __Pyx_GOTREF(__pyx_t_7);
10971 __Pyx_GOTREF(__pyx_t_8);
10972 __Pyx_GOTREF(__pyx_t_6);
10981 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
10982 __Pyx_XDECREF(__pyx_r);
10983 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10984 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10985 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10986 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10987 goto __pyx_L7_except_return;
10989 goto __pyx_L6_except_error;
10990 __pyx_L6_except_error:;
10999 __Pyx_XGIVEREF(__pyx_t_3);
11000 __Pyx_XGIVEREF(__pyx_t_4);
11001 __Pyx_XGIVEREF(__pyx_t_5);
11002 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11003 goto __pyx_L1_error;
11004 __pyx_L7_except_return:;
11005 __Pyx_XGIVEREF(__pyx_t_3);
11006 __Pyx_XGIVEREF(__pyx_t_4);
11007 __Pyx_XGIVEREF(__pyx_t_5);
11008 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11029 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
11030 __Pyx_XDECREF(__pyx_r);
11031 __Pyx_INCREF(__pyx_v_obj);
11032 __pyx_r = __pyx_v_obj;
11045 __Pyx_XDECREF(__pyx_t_6);
11046 __Pyx_XDECREF(__pyx_t_7);
11047 __Pyx_XDECREF(__pyx_t_8);
11048 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11051 __Pyx_XDECREF(__pyx_v_obj);
11052 __Pyx_XGIVEREF(__pyx_r);
11053 __Pyx_TraceReturn(__pyx_r, 0);
11054 __Pyx_RefNannyFinishContext();
11066 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11067 __Pyx_memviewslice __pyx_v_dst_slice;
11068 __Pyx_memviewslice __pyx_v_src_slice;
11069 PyObject *__pyx_r = NULL;
11070 __Pyx_TraceDeclarations
11071 __Pyx_RefNannyDeclarations
11072 __Pyx_memviewslice *__pyx_t_1;
11073 __Pyx_memviewslice *__pyx_t_2;
11074 PyObject *__pyx_t_3 = NULL;
11078 int __pyx_lineno = 0;
11079 const char *__pyx_filename = NULL;
11080 int __pyx_clineno = 0;
11081 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11082 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
11091 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11092 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
11093 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
11102 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
11103 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
11104 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
11113 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
11114 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11115 __Pyx_GOTREF(__pyx_t_3);
11116 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11117 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11118 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11119 __Pyx_GOTREF(__pyx_t_3);
11120 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11121 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11130 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11131 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
11142 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11145 __Pyx_XDECREF(__pyx_t_3);
11146 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11149 __Pyx_XGIVEREF(__pyx_r);
11150 __Pyx_TraceReturn(__pyx_r, 0);
11151 __Pyx_RefNannyFinishContext();
11163 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11164 int __pyx_v_array[0x80];
11166 void *__pyx_v_item;
11167 __Pyx_memviewslice *__pyx_v_dst_slice;
11168 __Pyx_memviewslice __pyx_v_tmp_slice;
11169 PyObject *__pyx_r = NULL;
11170 __Pyx_TraceDeclarations
11171 __Pyx_RefNannyDeclarations
11172 __Pyx_memviewslice *__pyx_t_1;
11174 PyObject *__pyx_t_3 = NULL;
11177 char const *__pyx_t_6;
11178 PyObject *__pyx_t_7 = NULL;
11179 PyObject *__pyx_t_8 = NULL;
11180 PyObject *__pyx_t_9 = NULL;
11181 PyObject *__pyx_t_10 = NULL;
11182 PyObject *__pyx_t_11 = NULL;
11183 PyObject *__pyx_t_12 = NULL;
11184 int __pyx_lineno = 0;
11185 const char *__pyx_filename = NULL;
11186 int __pyx_clineno = 0;
11187 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11188 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
11197 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
11198 __pyx_v_tmp = NULL;
11207 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
11208 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
11209 __pyx_v_dst_slice = __pyx_t_1;
11218 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11219 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11229 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11230 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11239 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11240 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11241 if (unlikely(__pyx_t_2)) {
11250 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
11251 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
11269 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11270 __pyx_v_item = __pyx_v_tmp;
11289 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11291 __pyx_v_item = ((
void *)__pyx_v_array);
11302 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
11312 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
11313 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11323 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11324 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11343 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
11345 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
11346 __Pyx_GOTREF(__pyx_t_3);
11347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11358 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11359 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11369 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
11370 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
11371 __Pyx_GOTREF(__pyx_t_3);
11372 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11390 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
11391 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11401 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
11404 PyMem_Free(__pyx_v_tmp);
11409 __Pyx_PyThreadState_declare
11410 __Pyx_PyThreadState_assign
11411 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11412 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11413 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11414 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11415 __Pyx_XGOTREF(__pyx_t_7);
11416 __Pyx_XGOTREF(__pyx_t_8);
11417 __Pyx_XGOTREF(__pyx_t_9);
11418 __Pyx_XGOTREF(__pyx_t_10);
11419 __Pyx_XGOTREF(__pyx_t_11);
11420 __Pyx_XGOTREF(__pyx_t_12);
11421 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11423 PyMem_Free(__pyx_v_tmp);
11425 if (PY_MAJOR_VERSION >= 3) {
11426 __Pyx_XGIVEREF(__pyx_t_10);
11427 __Pyx_XGIVEREF(__pyx_t_11);
11428 __Pyx_XGIVEREF(__pyx_t_12);
11429 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11431 __Pyx_XGIVEREF(__pyx_t_7);
11432 __Pyx_XGIVEREF(__pyx_t_8);
11433 __Pyx_XGIVEREF(__pyx_t_9);
11434 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11435 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11436 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11437 goto __pyx_L1_error;
11451 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11454 __Pyx_XDECREF(__pyx_t_3);
11455 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11458 __Pyx_XGIVEREF(__pyx_r);
11459 __Pyx_TraceReturn(__pyx_r, 0);
11460 __Pyx_RefNannyFinishContext();
11472 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11473 char *__pyx_v_itemp;
11474 PyObject *__pyx_r = NULL;
11475 __Pyx_TraceDeclarations
11476 __Pyx_RefNannyDeclarations
11478 PyObject *__pyx_t_2 = NULL;
11479 int __pyx_lineno = 0;
11480 const char *__pyx_filename = NULL;
11481 int __pyx_clineno = 0;
11482 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11483 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
11492 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
11493 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
11494 __pyx_v_itemp = __pyx_t_1;
11503 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
11504 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
11505 __Pyx_GOTREF(__pyx_t_2);
11506 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11517 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11520 __Pyx_XDECREF(__pyx_t_2);
11521 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11524 __Pyx_XGIVEREF(__pyx_r);
11525 __Pyx_TraceReturn(__pyx_r, 0);
11526 __Pyx_RefNannyFinishContext();
11538 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11539 PyObject *__pyx_v_struct = NULL;
11540 PyObject *__pyx_v_bytesitem = 0;
11541 PyObject *__pyx_v_result = NULL;
11542 PyObject *__pyx_r = NULL;
11543 __Pyx_TraceDeclarations
11544 __Pyx_RefNannyDeclarations
11545 PyObject *__pyx_t_1 = NULL;
11546 PyObject *__pyx_t_2 = NULL;
11547 PyObject *__pyx_t_3 = NULL;
11548 PyObject *__pyx_t_4 = NULL;
11549 PyObject *__pyx_t_5 = NULL;
11550 PyObject *__pyx_t_6 = NULL;
11551 PyObject *__pyx_t_7 = NULL;
11553 PyObject *__pyx_t_9 = NULL;
11556 int __pyx_lineno = 0;
11557 const char *__pyx_filename = NULL;
11558 int __pyx_clineno = 0;
11559 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
11560 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
11569 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
11570 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
11571 __Pyx_GOTREF(__pyx_t_1);
11572 __pyx_v_struct = __pyx_t_1;
11582 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
11583 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
11584 __Pyx_GOTREF(__pyx_t_1);
11585 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11595 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
11597 __Pyx_PyThreadState_declare
11598 __Pyx_PyThreadState_assign
11599 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11600 __Pyx_XGOTREF(__pyx_t_2);
11601 __Pyx_XGOTREF(__pyx_t_3);
11602 __Pyx_XGOTREF(__pyx_t_4);
11612 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
11613 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
11614 __Pyx_GOTREF(__pyx_t_5);
11615 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
11616 __Pyx_GOTREF(__pyx_t_6);
11619 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11620 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11621 if (likely(__pyx_t_7)) {
11622 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11623 __Pyx_INCREF(__pyx_t_7);
11624 __Pyx_INCREF(
function);
11625 __Pyx_DECREF_SET(__pyx_t_5,
function);
11629 #if CYTHON_FAST_PYCALL
11630 if (PyFunction_Check(__pyx_t_5)) {
11631 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11632 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11633 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11634 __Pyx_GOTREF(__pyx_t_1);
11635 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11638 #if CYTHON_FAST_PYCCALL
11639 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11640 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11641 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11642 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11643 __Pyx_GOTREF(__pyx_t_1);
11644 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11648 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
11649 __Pyx_GOTREF(__pyx_t_9);
11651 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11653 __Pyx_GIVEREF(__pyx_t_6);
11654 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11655 __Pyx_INCREF(__pyx_v_bytesitem);
11656 __Pyx_GIVEREF(__pyx_v_bytesitem);
11657 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11659 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11660 __Pyx_GOTREF(__pyx_t_1);
11661 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11663 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11664 __pyx_v_result = __pyx_t_1;
11683 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11685 __pyx_t_10 = strlen(__pyx_v_self->view.format);
11686 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11696 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11697 __Pyx_XDECREF(__pyx_r);
11698 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11699 __Pyx_GOTREF(__pyx_t_1);
11700 __pyx_r = __pyx_t_1;
11702 goto __pyx_L6_except_return;
11720 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11721 __Pyx_XDECREF(__pyx_r);
11722 __Pyx_INCREF(__pyx_v_result);
11723 __pyx_r = __pyx_v_result;
11724 goto __pyx_L6_except_return;
11727 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11728 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11729 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11730 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11731 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11740 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11741 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11742 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11743 __Pyx_GOTREF(__pyx_t_6);
11744 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11745 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11746 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11747 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11749 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11750 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11751 __Pyx_GOTREF(__pyx_t_9);
11752 __Pyx_GOTREF(__pyx_t_5);
11753 __Pyx_GOTREF(__pyx_t_1);
11762 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11763 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11764 __Pyx_GOTREF(__pyx_t_6);
11765 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11766 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11767 __PYX_ERR(1, 497, __pyx_L5_except_error)
11769 goto __pyx_L5_except_error;
11770 __pyx_L5_except_error:;
11779 __Pyx_XGIVEREF(__pyx_t_2);
11780 __Pyx_XGIVEREF(__pyx_t_3);
11781 __Pyx_XGIVEREF(__pyx_t_4);
11782 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11783 goto __pyx_L1_error;
11784 __pyx_L6_except_return:;
11785 __Pyx_XGIVEREF(__pyx_t_2);
11786 __Pyx_XGIVEREF(__pyx_t_3);
11787 __Pyx_XGIVEREF(__pyx_t_4);
11788 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11802 __Pyx_XDECREF(__pyx_t_1);
11803 __Pyx_XDECREF(__pyx_t_5);
11804 __Pyx_XDECREF(__pyx_t_6);
11805 __Pyx_XDECREF(__pyx_t_7);
11806 __Pyx_XDECREF(__pyx_t_9);
11807 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11810 __Pyx_XDECREF(__pyx_v_struct);
11811 __Pyx_XDECREF(__pyx_v_bytesitem);
11812 __Pyx_XDECREF(__pyx_v_result);
11813 __Pyx_XGIVEREF(__pyx_r);
11814 __Pyx_TraceReturn(__pyx_r, 0);
11815 __Pyx_RefNannyFinishContext();
11827 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11828 PyObject *__pyx_v_struct = NULL;
11830 PyObject *__pyx_v_bytesvalue = 0;
11831 Py_ssize_t __pyx_v_i;
11832 PyObject *__pyx_r = NULL;
11833 __Pyx_TraceDeclarations
11834 __Pyx_RefNannyDeclarations
11835 PyObject *__pyx_t_1 = NULL;
11838 PyObject *__pyx_t_4 = NULL;
11839 PyObject *__pyx_t_5 = NULL;
11840 PyObject *__pyx_t_6 = NULL;
11842 PyObject *__pyx_t_8 = NULL;
11843 Py_ssize_t __pyx_t_9;
11844 PyObject *__pyx_t_10 = NULL;
11849 int __pyx_lineno = 0;
11850 const char *__pyx_filename = NULL;
11851 int __pyx_clineno = 0;
11852 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11853 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11862 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11863 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11864 __Pyx_GOTREF(__pyx_t_1);
11865 __pyx_v_struct = __pyx_t_1;
11875 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11876 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11877 __pyx_t_3 = (__pyx_t_2 != 0);
11887 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11888 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11889 __Pyx_GOTREF(__pyx_t_1);
11890 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11891 __Pyx_GOTREF(__pyx_t_4);
11892 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11893 __Pyx_GOTREF(__pyx_t_5);
11894 __Pyx_GIVEREF(__pyx_t_4);
11895 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11897 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11898 __Pyx_GOTREF(__pyx_t_4);
11899 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11900 __Pyx_GOTREF(__pyx_t_6);
11901 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11902 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11903 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11904 __Pyx_GOTREF(__pyx_t_4);
11905 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11906 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11907 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11908 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11928 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11930 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
11931 __Pyx_GOTREF(__pyx_t_6);
11932 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
11933 __Pyx_GOTREF(__pyx_t_1);
11936 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11937 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11938 if (likely(__pyx_t_5)) {
11939 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
11940 __Pyx_INCREF(__pyx_t_5);
11941 __Pyx_INCREF(
function);
11942 __Pyx_DECREF_SET(__pyx_t_6,
function);
11946 #if CYTHON_FAST_PYCALL
11947 if (PyFunction_Check(__pyx_t_6)) {
11948 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11949 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11950 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11951 __Pyx_GOTREF(__pyx_t_4);
11952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11955 #if CYTHON_FAST_PYCCALL
11956 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11957 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11958 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11959 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11960 __Pyx_GOTREF(__pyx_t_4);
11961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11965 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
11966 __Pyx_GOTREF(__pyx_t_8);
11968 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11970 __Pyx_GIVEREF(__pyx_t_1);
11971 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11972 __Pyx_INCREF(__pyx_v_value);
11973 __Pyx_GIVEREF(__pyx_v_value);
11974 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11976 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11977 __Pyx_GOTREF(__pyx_t_4);
11978 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11980 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11981 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
11982 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11994 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11996 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11997 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
11998 __PYX_ERR(1, 516, __pyx_L1_error)
12000 __Pyx_INCREF(__pyx_v_bytesvalue);
12001 __pyx_t_10 = __pyx_v_bytesvalue;
12002 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12003 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12004 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12005 __pyx_t_11 = __pyx_t_14;
12006 __pyx_v_c = (__pyx_t_11[0]);
12015 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12016 __pyx_v_i = __pyx_t_9;
12025 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12026 __pyx_t_9 = (__pyx_t_9 + 1);
12035 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12036 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12038 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12049 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12052 __Pyx_XDECREF(__pyx_t_1);
12053 __Pyx_XDECREF(__pyx_t_4);
12054 __Pyx_XDECREF(__pyx_t_5);
12055 __Pyx_XDECREF(__pyx_t_6);
12056 __Pyx_XDECREF(__pyx_t_8);
12057 __Pyx_XDECREF(__pyx_t_10);
12058 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12061 __Pyx_XDECREF(__pyx_v_struct);
12062 __Pyx_XDECREF(__pyx_v_bytesvalue);
12063 __Pyx_XGIVEREF(__pyx_r);
12064 __Pyx_TraceReturn(__pyx_r, 0);
12065 __Pyx_RefNannyFinishContext();
12078 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12079 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12081 __Pyx_RefNannyDeclarations
12082 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12083 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12086 __Pyx_RefNannyFinishContext();
12090 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12092 __Pyx_TraceDeclarations
12093 __Pyx_RefNannyDeclarations
12096 PyObject *__pyx_t_3 = NULL;
12097 Py_ssize_t *__pyx_t_4;
12101 Py_ssize_t __pyx_t_8;
12102 int __pyx_lineno = 0;
12103 const char *__pyx_filename = NULL;
12104 int __pyx_clineno = 0;
12105 if (__pyx_v_info == NULL) {
12106 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12109 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12110 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12111 __Pyx_GIVEREF(__pyx_v_info->obj);
12112 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
12121 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
12122 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12125 __pyx_t_1 = __pyx_t_2;
12126 goto __pyx_L4_bool_binop_done;
12128 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12129 __pyx_t_1 = __pyx_t_2;
12130 __pyx_L4_bool_binop_done:;
12131 if (unlikely(__pyx_t_1)) {
12140 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
12141 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
12142 __Pyx_GOTREF(__pyx_t_3);
12143 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12144 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12145 __PYX_ERR(1, 522, __pyx_L1_error)
12163 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
12164 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12174 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
12175 __pyx_t_4 = __pyx_v_self->view.shape;
12176 __pyx_v_info->shape = __pyx_t_4;
12195 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
12197 __pyx_v_info->shape = NULL;
12208 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
12209 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12219 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12220 __pyx_t_4 = __pyx_v_self->view.strides;
12221 __pyx_v_info->strides = __pyx_t_4;
12240 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12242 __pyx_v_info->strides = NULL;
12253 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
12254 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12264 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12265 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12266 __pyx_v_info->suboffsets = __pyx_t_4;
12285 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12287 __pyx_v_info->suboffsets = NULL;
12298 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
12299 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12309 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12310 __pyx_t_5 = __pyx_v_self->view.format;
12311 __pyx_v_info->format = __pyx_t_5;
12330 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12332 __pyx_v_info->format = NULL;
12343 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12344 __pyx_t_6 = __pyx_v_self->view.buf;
12345 __pyx_v_info->buf = __pyx_t_6;
12354 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12355 __pyx_t_7 = __pyx_v_self->view.ndim;
12356 __pyx_v_info->ndim = __pyx_t_7;
12365 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12366 __pyx_t_8 = __pyx_v_self->view.itemsize;
12367 __pyx_v_info->itemsize = __pyx_t_8;
12376 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12377 __pyx_t_8 = __pyx_v_self->view.len;
12378 __pyx_v_info->len = __pyx_t_8;
12387 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
12388 __pyx_t_1 = __pyx_v_self->view.readonly;
12389 __pyx_v_info->readonly = __pyx_t_1;
12398 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
12399 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12400 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12401 __Pyx_GOTREF(__pyx_v_info->obj);
12402 __Pyx_DECREF(__pyx_v_info->obj);
12403 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12417 __Pyx_XDECREF(__pyx_t_3);
12418 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12420 if (__pyx_v_info->obj != NULL) {
12421 __Pyx_GOTREF(__pyx_v_info->obj);
12422 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12426 if (__pyx_v_info->obj == Py_None) {
12427 __Pyx_GOTREF(__pyx_v_info->obj);
12428 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12431 __Pyx_TraceReturn(Py_None, 0);
12432 __Pyx_RefNannyFinishContext();
12445 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12446 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12447 PyObject *__pyx_r = 0;
12448 __Pyx_RefNannyDeclarations
12449 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12450 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12453 __Pyx_RefNannyFinishContext();
12457 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12458 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12459 PyObject *__pyx_r = NULL;
12460 __Pyx_TraceDeclarations
12461 __Pyx_RefNannyDeclarations
12462 PyObject *__pyx_t_1 = NULL;
12464 int __pyx_lineno = 0;
12465 const char *__pyx_filename = NULL;
12466 int __pyx_clineno = 0;
12467 __Pyx_RefNannySetupContext(
"__get__", 0);
12468 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
12477 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12478 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
12479 __Pyx_GOTREF(__pyx_t_1);
12480 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
12481 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12491 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
12492 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
12501 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
12502 __Pyx_XDECREF(__pyx_r);
12503 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12504 __pyx_r = ((PyObject *)__pyx_v_result);
12517 __Pyx_XDECREF(__pyx_t_1);
12518 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12521 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12522 __Pyx_XGIVEREF(__pyx_r);
12523 __Pyx_TraceReturn(__pyx_r, 0);
12524 __Pyx_RefNannyFinishContext();
12537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12538 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12539 PyObject *__pyx_r = 0;
12540 __Pyx_RefNannyDeclarations
12541 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12542 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12545 __Pyx_RefNannyFinishContext();
12549 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12550 PyObject *__pyx_r = NULL;
12551 __Pyx_TraceDeclarations
12552 __Pyx_RefNannyDeclarations
12553 int __pyx_lineno = 0;
12554 const char *__pyx_filename = NULL;
12555 int __pyx_clineno = 0;
12556 __Pyx_RefNannySetupContext(
"__get__", 0);
12557 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
12566 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
12567 __Pyx_XDECREF(__pyx_r);
12568 __Pyx_INCREF(__pyx_v_self->obj);
12569 __pyx_r = __pyx_v_self->obj;
12582 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12585 __Pyx_XGIVEREF(__pyx_r);
12586 __Pyx_TraceReturn(__pyx_r, 0);
12587 __Pyx_RefNannyFinishContext();
12600 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12601 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12602 PyObject *__pyx_r = 0;
12603 __Pyx_RefNannyDeclarations
12604 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12605 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12608 __Pyx_RefNannyFinishContext();
12612 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12613 Py_ssize_t __pyx_v_length;
12614 PyObject *__pyx_r = NULL;
12615 __Pyx_TraceDeclarations
12616 __Pyx_RefNannyDeclarations
12617 PyObject *__pyx_t_1 = NULL;
12618 Py_ssize_t *__pyx_t_2;
12619 Py_ssize_t *__pyx_t_3;
12620 Py_ssize_t *__pyx_t_4;
12621 PyObject *__pyx_t_5 = NULL;
12622 int __pyx_lineno = 0;
12623 const char *__pyx_filename = NULL;
12624 int __pyx_clineno = 0;
12625 __Pyx_RefNannySetupContext(
"__get__", 0);
12626 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
12635 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
12636 __Pyx_XDECREF(__pyx_r);
12637 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
12638 __Pyx_GOTREF(__pyx_t_1);
12639 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12640 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12641 __pyx_t_2 = __pyx_t_4;
12642 __pyx_v_length = (__pyx_t_2[0]);
12643 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12644 __Pyx_GOTREF(__pyx_t_5);
12645 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
12646 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12648 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12649 __Pyx_GOTREF(__pyx_t_5);
12650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12651 __pyx_r = __pyx_t_5;
12665 __Pyx_XDECREF(__pyx_t_1);
12666 __Pyx_XDECREF(__pyx_t_5);
12667 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12670 __Pyx_XGIVEREF(__pyx_r);
12671 __Pyx_TraceReturn(__pyx_r, 0);
12672 __Pyx_RefNannyFinishContext();
12685 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
12686 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12687 PyObject *__pyx_r = 0;
12688 __Pyx_RefNannyDeclarations
12689 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12690 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12693 __Pyx_RefNannyFinishContext();
12697 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12698 Py_ssize_t __pyx_v_stride;
12699 PyObject *__pyx_r = NULL;
12700 __Pyx_TraceDeclarations
12701 __Pyx_RefNannyDeclarations
12703 PyObject *__pyx_t_2 = NULL;
12704 Py_ssize_t *__pyx_t_3;
12705 Py_ssize_t *__pyx_t_4;
12706 Py_ssize_t *__pyx_t_5;
12707 PyObject *__pyx_t_6 = NULL;
12708 int __pyx_lineno = 0;
12709 const char *__pyx_filename = NULL;
12710 int __pyx_clineno = 0;
12711 __Pyx_RefNannySetupContext(
"__get__", 0);
12712 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12721 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12722 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12723 if (unlikely(__pyx_t_1)) {
12732 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12733 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12734 __Pyx_GOTREF(__pyx_t_2);
12735 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12736 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12737 __PYX_ERR(1, 572, __pyx_L1_error)
12755 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12756 __Pyx_XDECREF(__pyx_r);
12757 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12758 __Pyx_GOTREF(__pyx_t_2);
12759 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12760 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12761 __pyx_t_3 = __pyx_t_5;
12762 __pyx_v_stride = (__pyx_t_3[0]);
12763 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12764 __Pyx_GOTREF(__pyx_t_6);
12765 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12766 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12768 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12769 __Pyx_GOTREF(__pyx_t_6);
12770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12771 __pyx_r = __pyx_t_6;
12785 __Pyx_XDECREF(__pyx_t_2);
12786 __Pyx_XDECREF(__pyx_t_6);
12787 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12790 __Pyx_XGIVEREF(__pyx_r);
12791 __Pyx_TraceReturn(__pyx_r, 0);
12792 __Pyx_RefNannyFinishContext();
12805 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12806 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12807 PyObject *__pyx_r = 0;
12808 __Pyx_RefNannyDeclarations
12809 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12810 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12813 __Pyx_RefNannyFinishContext();
12817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12818 Py_ssize_t __pyx_v_suboffset;
12819 PyObject *__pyx_r = NULL;
12820 __Pyx_TraceDeclarations
12821 __Pyx_RefNannyDeclarations
12823 PyObject *__pyx_t_2 = NULL;
12824 PyObject *__pyx_t_3 = NULL;
12825 Py_ssize_t *__pyx_t_4;
12826 Py_ssize_t *__pyx_t_5;
12827 Py_ssize_t *__pyx_t_6;
12828 int __pyx_lineno = 0;
12829 const char *__pyx_filename = NULL;
12830 int __pyx_clineno = 0;
12831 __Pyx_RefNannySetupContext(
"__get__", 0);
12832 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12841 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12842 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12852 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12853 __Pyx_XDECREF(__pyx_r);
12854 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12855 __Pyx_GOTREF(__pyx_t_2);
12856 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12857 __Pyx_GOTREF(__pyx_t_3);
12858 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12859 __pyx_r = __pyx_t_3;
12879 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12880 __Pyx_XDECREF(__pyx_r);
12881 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12882 __Pyx_GOTREF(__pyx_t_3);
12883 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12884 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12885 __pyx_t_4 = __pyx_t_6;
12886 __pyx_v_suboffset = (__pyx_t_4[0]);
12887 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12888 __Pyx_GOTREF(__pyx_t_2);
12889 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12890 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12892 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12893 __Pyx_GOTREF(__pyx_t_2);
12894 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12895 __pyx_r = __pyx_t_2;
12909 __Pyx_XDECREF(__pyx_t_2);
12910 __Pyx_XDECREF(__pyx_t_3);
12911 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12914 __Pyx_XGIVEREF(__pyx_r);
12915 __Pyx_TraceReturn(__pyx_r, 0);
12916 __Pyx_RefNannyFinishContext();
12929 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
12930 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12931 PyObject *__pyx_r = 0;
12932 __Pyx_RefNannyDeclarations
12933 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12934 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12937 __Pyx_RefNannyFinishContext();
12941 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12942 PyObject *__pyx_r = NULL;
12943 __Pyx_TraceDeclarations
12944 __Pyx_RefNannyDeclarations
12945 PyObject *__pyx_t_1 = NULL;
12946 int __pyx_lineno = 0;
12947 const char *__pyx_filename = NULL;
12948 int __pyx_clineno = 0;
12949 __Pyx_RefNannySetupContext(
"__get__", 0);
12950 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
12959 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
12960 __Pyx_XDECREF(__pyx_r);
12961 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
12962 __Pyx_GOTREF(__pyx_t_1);
12963 __pyx_r = __pyx_t_1;
12977 __Pyx_XDECREF(__pyx_t_1);
12978 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12981 __Pyx_XGIVEREF(__pyx_r);
12982 __Pyx_TraceReturn(__pyx_r, 0);
12983 __Pyx_RefNannyFinishContext();
12996 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
12997 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12998 PyObject *__pyx_r = 0;
12999 __Pyx_RefNannyDeclarations
13000 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13001 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13004 __Pyx_RefNannyFinishContext();
13008 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13009 PyObject *__pyx_r = NULL;
13010 __Pyx_TraceDeclarations
13011 __Pyx_RefNannyDeclarations
13012 PyObject *__pyx_t_1 = NULL;
13013 int __pyx_lineno = 0;
13014 const char *__pyx_filename = NULL;
13015 int __pyx_clineno = 0;
13016 __Pyx_RefNannySetupContext(
"__get__", 0);
13017 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
13026 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
13027 __Pyx_XDECREF(__pyx_r);
13028 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
13029 __Pyx_GOTREF(__pyx_t_1);
13030 __pyx_r = __pyx_t_1;
13044 __Pyx_XDECREF(__pyx_t_1);
13045 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13048 __Pyx_XGIVEREF(__pyx_r);
13049 __Pyx_TraceReturn(__pyx_r, 0);
13050 __Pyx_RefNannyFinishContext();
13063 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13064 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13065 PyObject *__pyx_r = 0;
13066 __Pyx_RefNannyDeclarations
13067 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13068 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13071 __Pyx_RefNannyFinishContext();
13075 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13076 PyObject *__pyx_r = NULL;
13077 __Pyx_TraceDeclarations
13078 __Pyx_RefNannyDeclarations
13079 PyObject *__pyx_t_1 = NULL;
13080 PyObject *__pyx_t_2 = NULL;
13081 PyObject *__pyx_t_3 = NULL;
13082 int __pyx_lineno = 0;
13083 const char *__pyx_filename = NULL;
13084 int __pyx_clineno = 0;
13085 __Pyx_RefNannySetupContext(
"__get__", 0);
13086 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
13095 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
13096 __Pyx_XDECREF(__pyx_r);
13097 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
13098 __Pyx_GOTREF(__pyx_t_1);
13099 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
13100 __Pyx_GOTREF(__pyx_t_2);
13101 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
13102 __Pyx_GOTREF(__pyx_t_3);
13103 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13105 __pyx_r = __pyx_t_3;
13119 __Pyx_XDECREF(__pyx_t_1);
13120 __Pyx_XDECREF(__pyx_t_2);
13121 __Pyx_XDECREF(__pyx_t_3);
13122 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13125 __Pyx_XGIVEREF(__pyx_r);
13126 __Pyx_TraceReturn(__pyx_r, 0);
13127 __Pyx_RefNannyFinishContext();
13140 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13141 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13142 PyObject *__pyx_r = 0;
13143 __Pyx_RefNannyDeclarations
13144 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13145 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13148 __Pyx_RefNannyFinishContext();
13152 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13153 PyObject *__pyx_v_result = NULL;
13154 PyObject *__pyx_v_length = NULL;
13155 PyObject *__pyx_r = NULL;
13156 __Pyx_TraceDeclarations
13157 __Pyx_RefNannyDeclarations
13160 Py_ssize_t *__pyx_t_3;
13161 Py_ssize_t *__pyx_t_4;
13162 Py_ssize_t *__pyx_t_5;
13163 PyObject *__pyx_t_6 = NULL;
13164 int __pyx_lineno = 0;
13165 const char *__pyx_filename = NULL;
13166 int __pyx_clineno = 0;
13167 __Pyx_RefNannySetupContext(
"__get__", 0);
13168 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
13177 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
13178 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13179 __pyx_t_2 = (__pyx_t_1 != 0);
13189 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
13190 __Pyx_INCREF(__pyx_int_1);
13191 __pyx_v_result = __pyx_int_1;
13200 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
13201 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13202 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13203 __pyx_t_3 = __pyx_t_5;
13204 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
13205 __Pyx_GOTREF(__pyx_t_6);
13206 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13216 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
13217 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
13218 __Pyx_GOTREF(__pyx_t_6);
13219 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13230 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13231 __Pyx_INCREF(__pyx_v_result);
13232 __Pyx_GIVEREF(__pyx_v_result);
13233 __Pyx_GOTREF(__pyx_v_self->_size);
13234 __Pyx_DECREF(__pyx_v_self->_size);
13235 __pyx_v_self->_size = __pyx_v_result;
13253 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
13254 __Pyx_XDECREF(__pyx_r);
13255 __Pyx_INCREF(__pyx_v_self->_size);
13256 __pyx_r = __pyx_v_self->_size;
13269 __Pyx_XDECREF(__pyx_t_6);
13270 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13273 __Pyx_XDECREF(__pyx_v_result);
13274 __Pyx_XDECREF(__pyx_v_length);
13275 __Pyx_XGIVEREF(__pyx_r);
13276 __Pyx_TraceReturn(__pyx_r, 0);
13277 __Pyx_RefNannyFinishContext();
13290 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13291 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13292 Py_ssize_t __pyx_r;
13293 __Pyx_RefNannyDeclarations
13294 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13295 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13298 __Pyx_RefNannyFinishContext();
13302 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13303 Py_ssize_t __pyx_r;
13304 __Pyx_TraceDeclarations
13305 __Pyx_RefNannyDeclarations
13307 int __pyx_lineno = 0;
13308 const char *__pyx_filename = NULL;
13309 int __pyx_clineno = 0;
13310 __Pyx_RefNannySetupContext(
"__len__", 0);
13311 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
13320 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
13321 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13331 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13332 __pyx_r = (__pyx_v_self->view.shape[0]);
13351 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
13365 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13368 __Pyx_TraceReturn(Py_None, 0);
13369 __Pyx_RefNannyFinishContext();
13382 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13383 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13384 PyObject *__pyx_r = 0;
13385 __Pyx_RefNannyDeclarations
13386 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13387 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13390 __Pyx_RefNannyFinishContext();
13394 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13395 PyObject *__pyx_r = NULL;
13396 __Pyx_TraceDeclarations
13397 __Pyx_RefNannyDeclarations
13398 PyObject *__pyx_t_1 = NULL;
13399 PyObject *__pyx_t_2 = NULL;
13400 PyObject *__pyx_t_3 = NULL;
13401 int __pyx_lineno = 0;
13402 const char *__pyx_filename = NULL;
13403 int __pyx_clineno = 0;
13404 __Pyx_RefNannySetupContext(
"__repr__", 0);
13405 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
13414 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13415 __Pyx_XDECREF(__pyx_r);
13416 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13417 __Pyx_GOTREF(__pyx_t_1);
13418 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13419 __Pyx_GOTREF(__pyx_t_2);
13420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13421 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13422 __Pyx_GOTREF(__pyx_t_1);
13423 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13432 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
13433 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
13434 __Pyx_GOTREF(__pyx_t_2);
13443 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13444 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
13445 __Pyx_GOTREF(__pyx_t_3);
13446 __Pyx_GIVEREF(__pyx_t_1);
13447 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13448 __Pyx_GIVEREF(__pyx_t_2);
13449 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13452 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13453 __Pyx_GOTREF(__pyx_t_2);
13454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13455 __pyx_r = __pyx_t_2;
13469 __Pyx_XDECREF(__pyx_t_1);
13470 __Pyx_XDECREF(__pyx_t_2);
13471 __Pyx_XDECREF(__pyx_t_3);
13472 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13475 __Pyx_XGIVEREF(__pyx_r);
13476 __Pyx_TraceReturn(__pyx_r, 0);
13477 __Pyx_RefNannyFinishContext();
13490 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13491 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13492 PyObject *__pyx_r = 0;
13493 __Pyx_RefNannyDeclarations
13494 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13495 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13498 __Pyx_RefNannyFinishContext();
13502 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13503 PyObject *__pyx_r = NULL;
13504 __Pyx_TraceDeclarations
13505 __Pyx_RefNannyDeclarations
13506 PyObject *__pyx_t_1 = NULL;
13507 PyObject *__pyx_t_2 = NULL;
13508 int __pyx_lineno = 0;
13509 const char *__pyx_filename = NULL;
13510 int __pyx_clineno = 0;
13511 __Pyx_RefNannySetupContext(
"__str__", 0);
13512 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
13521 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
13522 __Pyx_XDECREF(__pyx_r);
13523 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13524 __Pyx_GOTREF(__pyx_t_1);
13525 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13526 __Pyx_GOTREF(__pyx_t_2);
13527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13528 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13529 __Pyx_GOTREF(__pyx_t_1);
13530 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13531 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13532 __Pyx_GOTREF(__pyx_t_2);
13533 __Pyx_GIVEREF(__pyx_t_1);
13534 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13536 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13537 __Pyx_GOTREF(__pyx_t_1);
13538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13539 __pyx_r = __pyx_t_1;
13553 __Pyx_XDECREF(__pyx_t_1);
13554 __Pyx_XDECREF(__pyx_t_2);
13555 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13558 __Pyx_XGIVEREF(__pyx_r);
13559 __Pyx_TraceReturn(__pyx_r, 0);
13560 __Pyx_RefNannyFinishContext();
13573 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13574 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13575 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13576 PyObject *__pyx_r = 0;
13577 __Pyx_RefNannyDeclarations
13578 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13579 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13582 __Pyx_RefNannyFinishContext();
13586 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13587 __Pyx_memviewslice *__pyx_v_mslice;
13588 __Pyx_memviewslice __pyx_v_tmp;
13589 PyObject *__pyx_r = NULL;
13590 __Pyx_TraceDeclarations
13591 __Pyx_RefNannyDeclarations
13592 __Pyx_memviewslice *__pyx_t_1;
13593 PyObject *__pyx_t_2 = NULL;
13594 int __pyx_lineno = 0;
13595 const char *__pyx_filename = NULL;
13596 int __pyx_clineno = 0;
13597 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13598 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
13607 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
13608 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
13609 __pyx_v_mslice = __pyx_t_1;
13618 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
13619 __Pyx_XDECREF(__pyx_r);
13620 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
13621 __Pyx_GOTREF(__pyx_t_2);
13622 __pyx_r = __pyx_t_2;
13636 __Pyx_XDECREF(__pyx_t_2);
13637 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13640 __Pyx_XGIVEREF(__pyx_r);
13641 __Pyx_TraceReturn(__pyx_r, 0);
13642 __Pyx_RefNannyFinishContext();
13655 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13656 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13657 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13658 PyObject *__pyx_r = 0;
13659 __Pyx_RefNannyDeclarations
13660 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13661 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13664 __Pyx_RefNannyFinishContext();
13668 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13669 __Pyx_memviewslice *__pyx_v_mslice;
13670 __Pyx_memviewslice __pyx_v_tmp;
13671 PyObject *__pyx_r = NULL;
13672 __Pyx_TraceDeclarations
13673 __Pyx_RefNannyDeclarations
13674 __Pyx_memviewslice *__pyx_t_1;
13675 PyObject *__pyx_t_2 = NULL;
13676 int __pyx_lineno = 0;
13677 const char *__pyx_filename = NULL;
13678 int __pyx_clineno = 0;
13679 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13680 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
13689 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
13690 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13691 __pyx_v_mslice = __pyx_t_1;
13700 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13701 __Pyx_XDECREF(__pyx_r);
13702 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13703 __Pyx_GOTREF(__pyx_t_2);
13704 __pyx_r = __pyx_t_2;
13718 __Pyx_XDECREF(__pyx_t_2);
13719 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13722 __Pyx_XGIVEREF(__pyx_r);
13723 __Pyx_TraceReturn(__pyx_r, 0);
13724 __Pyx_RefNannyFinishContext();
13737 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13738 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13739 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13740 PyObject *__pyx_r = 0;
13741 __Pyx_RefNannyDeclarations
13742 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13743 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13746 __Pyx_RefNannyFinishContext();
13750 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13751 __Pyx_memviewslice __pyx_v_mslice;
13753 PyObject *__pyx_r = NULL;
13754 __Pyx_TraceDeclarations
13755 __Pyx_RefNannyDeclarations
13756 __Pyx_memviewslice __pyx_t_1;
13757 PyObject *__pyx_t_2 = NULL;
13758 int __pyx_lineno = 0;
13759 const char *__pyx_filename = NULL;
13760 int __pyx_clineno = 0;
13761 __Pyx_RefNannySetupContext(
"copy", 0);
13762 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13771 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13772 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13781 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13782 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13791 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13792 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13793 __pyx_v_mslice = __pyx_t_1;
13802 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13803 __Pyx_XDECREF(__pyx_r);
13804 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13805 __Pyx_GOTREF(__pyx_t_2);
13806 __pyx_r = __pyx_t_2;
13820 __Pyx_XDECREF(__pyx_t_2);
13821 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13824 __Pyx_XGIVEREF(__pyx_r);
13825 __Pyx_TraceReturn(__pyx_r, 0);
13826 __Pyx_RefNannyFinishContext();
13839 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13840 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13841 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13842 PyObject *__pyx_r = 0;
13843 __Pyx_RefNannyDeclarations
13844 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13845 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13848 __Pyx_RefNannyFinishContext();
13852 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13853 __Pyx_memviewslice __pyx_v_src;
13854 __Pyx_memviewslice __pyx_v_dst;
13856 PyObject *__pyx_r = NULL;
13857 __Pyx_TraceDeclarations
13858 __Pyx_RefNannyDeclarations
13859 __Pyx_memviewslice __pyx_t_1;
13860 PyObject *__pyx_t_2 = NULL;
13861 int __pyx_lineno = 0;
13862 const char *__pyx_filename = NULL;
13863 int __pyx_clineno = 0;
13864 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13865 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13874 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13875 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13884 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13885 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13894 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13895 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13896 __pyx_v_dst = __pyx_t_1;
13905 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13906 __Pyx_XDECREF(__pyx_r);
13907 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13908 __Pyx_GOTREF(__pyx_t_2);
13909 __pyx_r = __pyx_t_2;
13923 __Pyx_XDECREF(__pyx_t_2);
13924 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13927 __Pyx_XGIVEREF(__pyx_r);
13928 __Pyx_TraceReturn(__pyx_r, 0);
13929 __Pyx_RefNannyFinishContext();
13940 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13941 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13942 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13943 PyObject *__pyx_r = 0;
13944 __Pyx_RefNannyDeclarations
13945 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13946 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13949 __Pyx_RefNannyFinishContext();
13953 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
13954 PyObject *__pyx_r = NULL;
13955 __Pyx_TraceDeclarations
13956 __Pyx_RefNannyDeclarations
13957 PyObject *__pyx_t_1 = NULL;
13958 int __pyx_lineno = 0;
13959 const char *__pyx_filename = NULL;
13960 int __pyx_clineno = 0;
13961 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13962 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13970 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13971 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13972 __Pyx_GOTREF(__pyx_t_1);
13973 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13975 __PYX_ERR(1, 2, __pyx_L1_error)
13985 __Pyx_XDECREF(__pyx_t_1);
13986 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13988 __Pyx_XGIVEREF(__pyx_r);
13989 __Pyx_TraceReturn(__pyx_r, 0);
13990 __Pyx_RefNannyFinishContext();
14002 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14003 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14004 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14005 PyObject *__pyx_r = 0;
14006 __Pyx_RefNannyDeclarations
14007 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14008 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14011 __Pyx_RefNannyFinishContext();
14015 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14016 PyObject *__pyx_r = NULL;
14017 __Pyx_TraceDeclarations
14018 __Pyx_RefNannyDeclarations
14019 PyObject *__pyx_t_1 = NULL;
14020 int __pyx_lineno = 0;
14021 const char *__pyx_filename = NULL;
14022 int __pyx_clineno = 0;
14023 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14024 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14031 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
14032 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14033 __Pyx_GOTREF(__pyx_t_1);
14034 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14036 __PYX_ERR(1, 4, __pyx_L1_error)
14047 __Pyx_XDECREF(__pyx_t_1);
14048 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14050 __Pyx_XGIVEREF(__pyx_r);
14051 __Pyx_TraceReturn(__pyx_r, 0);
14052 __Pyx_RefNannyFinishContext();
14064 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14065 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14066 PyObject *__pyx_r = NULL;
14067 __Pyx_TraceDeclarations
14068 __Pyx_RefNannyDeclarations
14069 PyObject *__pyx_t_1 = NULL;
14070 PyObject *__pyx_t_2 = NULL;
14071 PyObject *__pyx_t_3 = NULL;
14072 int __pyx_lineno = 0;
14073 const char *__pyx_filename = NULL;
14074 int __pyx_clineno = 0;
14075 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14076 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
14085 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
14086 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
14087 __Pyx_GOTREF(__pyx_t_1);
14088 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14089 __Pyx_GOTREF(__pyx_t_2);
14090 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
14091 __Pyx_GOTREF(__pyx_t_3);
14092 __Pyx_INCREF(__pyx_v_o);
14093 __Pyx_GIVEREF(__pyx_v_o);
14094 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14095 __Pyx_GIVEREF(__pyx_t_1);
14096 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14097 __Pyx_GIVEREF(__pyx_t_2);
14098 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14101 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14102 __Pyx_GOTREF(__pyx_t_2);
14103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14104 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14114 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
14115 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14124 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
14125 __Pyx_XDECREF(__pyx_r);
14126 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14127 __pyx_r = ((PyObject *)__pyx_v_result);
14140 __Pyx_XDECREF(__pyx_t_1);
14141 __Pyx_XDECREF(__pyx_t_2);
14142 __Pyx_XDECREF(__pyx_t_3);
14143 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14146 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14147 __Pyx_XGIVEREF(__pyx_r);
14148 __Pyx_TraceReturn(__pyx_r, 0);
14149 __Pyx_RefNannyFinishContext();
14161 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14163 __Pyx_TraceDeclarations
14164 __Pyx_RefNannyDeclarations
14166 int __pyx_lineno = 0;
14167 const char *__pyx_filename = NULL;
14168 int __pyx_clineno = 0;
14169 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14170 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
14179 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
14180 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14181 __pyx_r = __pyx_t_1;
14194 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14197 __Pyx_TraceReturn(Py_None, 0);
14198 __Pyx_RefNannyFinishContext();
14210 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14211 PyObject *__pyx_v_tup = NULL;
14212 PyObject *__pyx_v_result = NULL;
14213 int __pyx_v_have_slices;
14214 int __pyx_v_seen_ellipsis;
14215 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14216 PyObject *__pyx_v_item = NULL;
14217 Py_ssize_t __pyx_v_nslices;
14218 PyObject *__pyx_r = NULL;
14219 __Pyx_TraceDeclarations
14220 __Pyx_RefNannyDeclarations
14223 PyObject *__pyx_t_3 = NULL;
14224 PyObject *__pyx_t_4 = NULL;
14225 Py_ssize_t __pyx_t_5;
14226 PyObject *(*__pyx_t_6)(PyObject *);
14227 PyObject *__pyx_t_7 = NULL;
14228 Py_ssize_t __pyx_t_8;
14231 PyObject *__pyx_t_11 = NULL;
14232 int __pyx_lineno = 0;
14233 const char *__pyx_filename = NULL;
14234 int __pyx_clineno = 0;
14235 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14236 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
14245 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
14246 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14247 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14257 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14258 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
14259 __Pyx_GOTREF(__pyx_t_3);
14260 __Pyx_INCREF(__pyx_v_index);
14261 __Pyx_GIVEREF(__pyx_v_index);
14262 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14263 __pyx_v_tup = __pyx_t_3;
14283 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14285 __Pyx_INCREF(__pyx_v_index);
14286 __pyx_v_tup = __pyx_v_index;
14297 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14298 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
14299 __Pyx_GOTREF(__pyx_t_3);
14300 __pyx_v_result = ((PyObject*)__pyx_t_3);
14310 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14311 __pyx_v_have_slices = 0;
14320 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14321 __pyx_v_seen_ellipsis = 0;
14330 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14331 __Pyx_INCREF(__pyx_int_0);
14332 __pyx_t_3 = __pyx_int_0;
14333 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14334 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14337 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
14338 __Pyx_GOTREF(__pyx_t_4);
14339 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
14342 if (likely(!__pyx_t_6)) {
14343 if (likely(PyList_CheckExact(__pyx_t_4))) {
14344 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14345 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14346 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14348 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14349 __Pyx_GOTREF(__pyx_t_7);
14352 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14353 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14354 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14356 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14357 __Pyx_GOTREF(__pyx_t_7);
14361 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14362 if (unlikely(!__pyx_t_7)) {
14363 PyObject* exc_type = PyErr_Occurred();
14365 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14366 else __PYX_ERR(1, 681, __pyx_L1_error)
14370 __Pyx_GOTREF(__pyx_t_7);
14372 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14374 __Pyx_INCREF(__pyx_t_3);
14375 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14376 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14377 __Pyx_GOTREF(__pyx_t_7);
14378 __Pyx_DECREF(__pyx_t_3);
14379 __pyx_t_3 = __pyx_t_7;
14389 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14390 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14391 __pyx_t_1 = (__pyx_t_2 != 0);
14401 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14402 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14412 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
14413 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14414 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14415 __Pyx_GOTREF(__pyx_t_7);
14416 { Py_ssize_t __pyx_temp;
14417 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14418 __Pyx_INCREF(__pyx_slice__32);
14419 __Pyx_GIVEREF(__pyx_slice__32);
14420 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14423 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14424 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14433 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14434 __pyx_v_seen_ellipsis = 1;
14453 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
14455 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
14466 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14467 __pyx_v_have_slices = 1;
14486 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
14488 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14489 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14492 __pyx_t_1 = __pyx_t_10;
14493 goto __pyx_L9_bool_binop_done;
14495 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14496 __pyx_t_1 = __pyx_t_10;
14497 __pyx_L9_bool_binop_done:;
14498 if (unlikely(__pyx_t_1)) {
14507 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14508 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
14509 __Pyx_GOTREF(__pyx_t_7);
14510 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
14511 __Pyx_GOTREF(__pyx_t_11);
14512 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14513 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14514 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14515 __PYX_ERR(1, 691, __pyx_L1_error)
14533 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
14534 __pyx_t_10 = (__pyx_v_have_slices != 0);
14537 __pyx_t_1 = __pyx_t_10;
14538 goto __pyx_L11_bool_binop_done;
14540 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14541 __pyx_t_2 = (__pyx_t_10 != 0);
14542 __pyx_t_1 = __pyx_t_2;
14543 __pyx_L11_bool_binop_done:;
14544 __pyx_v_have_slices = __pyx_t_1;
14553 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14554 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14565 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14577 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14578 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14579 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14588 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
14589 __pyx_t_1 = (__pyx_v_nslices != 0);
14599 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14600 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
14601 __Pyx_GOTREF(__pyx_t_3);
14602 { Py_ssize_t __pyx_temp;
14603 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14604 __Pyx_INCREF(__pyx_slice__32);
14605 __Pyx_GIVEREF(__pyx_slice__32);
14606 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14609 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
14610 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14628 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
14629 __Pyx_XDECREF(__pyx_r);
14630 if (!__pyx_v_have_slices) {
14632 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14633 __Pyx_GOTREF(__pyx_t_4);
14634 __pyx_t_3 = __pyx_t_4;
14636 goto __pyx_L14_bool_binop_done;
14638 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14639 __Pyx_GOTREF(__pyx_t_4);
14640 __pyx_t_3 = __pyx_t_4;
14642 __pyx_L14_bool_binop_done:;
14643 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14644 __Pyx_GOTREF(__pyx_t_4);
14645 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
14646 __Pyx_GOTREF(__pyx_t_11);
14647 __Pyx_GIVEREF(__pyx_t_3);
14648 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14649 __Pyx_GIVEREF(__pyx_t_4);
14650 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14653 __pyx_r = ((PyObject*)__pyx_t_11);
14667 __Pyx_XDECREF(__pyx_t_3);
14668 __Pyx_XDECREF(__pyx_t_4);
14669 __Pyx_XDECREF(__pyx_t_7);
14670 __Pyx_XDECREF(__pyx_t_11);
14671 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14674 __Pyx_XDECREF(__pyx_v_tup);
14675 __Pyx_XDECREF(__pyx_v_result);
14676 __Pyx_XDECREF(__pyx_v_idx);
14677 __Pyx_XDECREF(__pyx_v_item);
14678 __Pyx_XGIVEREF(__pyx_r);
14679 __Pyx_TraceReturn(__pyx_r, 0);
14680 __Pyx_RefNannyFinishContext();
14692 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14693 Py_ssize_t __pyx_v_suboffset;
14694 PyObject *__pyx_r = NULL;
14695 __Pyx_TraceDeclarations
14696 __Pyx_RefNannyDeclarations
14697 Py_ssize_t *__pyx_t_1;
14698 Py_ssize_t *__pyx_t_2;
14699 Py_ssize_t *__pyx_t_3;
14701 PyObject *__pyx_t_5 = NULL;
14702 int __pyx_lineno = 0;
14703 const char *__pyx_filename = NULL;
14704 int __pyx_clineno = 0;
14705 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14706 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14715 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14716 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14717 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14718 __pyx_t_1 = __pyx_t_3;
14719 __pyx_v_suboffset = (__pyx_t_1[0]);
14728 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14729 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14730 if (unlikely(__pyx_t_4)) {
14739 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14740 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14741 __Pyx_GOTREF(__pyx_t_5);
14742 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14743 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14744 __PYX_ERR(1, 705, __pyx_L1_error)
14765 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14768 __Pyx_XDECREF(__pyx_t_5);
14769 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14772 __Pyx_XGIVEREF(__pyx_r);
14773 __Pyx_TraceReturn(__pyx_r, 0);
14774 __Pyx_RefNannyFinishContext();
14786 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14787 int __pyx_v_new_ndim;
14788 int __pyx_v_suboffset_dim;
14790 __Pyx_memviewslice __pyx_v_src;
14791 __Pyx_memviewslice __pyx_v_dst;
14792 __Pyx_memviewslice *__pyx_v_p_src;
14793 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14794 __Pyx_memviewslice *__pyx_v_p_dst;
14795 int *__pyx_v_p_suboffset_dim;
14796 Py_ssize_t __pyx_v_start;
14797 Py_ssize_t __pyx_v_stop;
14798 Py_ssize_t __pyx_v_step;
14799 int __pyx_v_have_start;
14800 int __pyx_v_have_stop;
14801 int __pyx_v_have_step;
14802 PyObject *__pyx_v_index = NULL;
14803 struct __pyx_memoryview_obj *__pyx_r = NULL;
14804 __Pyx_TraceDeclarations
14805 __Pyx_RefNannyDeclarations
14808 PyObject *__pyx_t_3 = NULL;
14809 struct __pyx_memoryview_obj *__pyx_t_4;
14812 Py_ssize_t __pyx_t_7;
14813 PyObject *(*__pyx_t_8)(PyObject *);
14814 PyObject *__pyx_t_9 = NULL;
14815 Py_ssize_t __pyx_t_10;
14817 Py_ssize_t __pyx_t_12;
14818 int __pyx_lineno = 0;
14819 const char *__pyx_filename = NULL;
14820 int __pyx_clineno = 0;
14821 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14822 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14831 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14832 __pyx_v_new_ndim = 0;
14833 __pyx_v_suboffset_dim = -1;
14842 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14843 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14852 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14853 #ifndef CYTHON_WITHOUT_ASSERTIONS
14854 if (unlikely(__pyx_assertions_enabled())) {
14855 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14856 PyErr_SetNone(PyExc_AssertionError);
14857 __PYX_ERR(1, 724, __pyx_L1_error)
14869 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14870 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14871 __pyx_t_2 = (__pyx_t_1 != 0);
14881 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14882 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14883 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14884 __Pyx_INCREF(__pyx_t_3);
14885 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14895 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14896 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14915 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
14917 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14926 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
14927 __pyx_v_p_src = (&__pyx_v_src);
14938 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
14939 __pyx_t_4 = __pyx_v_p_src->memview;
14940 __pyx_v_dst.memview = __pyx_t_4;
14949 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
14950 __pyx_t_5 = __pyx_v_p_src->data;
14951 __pyx_v_dst.data = __pyx_t_5;
14960 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
14961 __pyx_v_p_dst = (&__pyx_v_dst);
14970 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
14971 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14980 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14982 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14983 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14986 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
14987 __Pyx_GOTREF(__pyx_t_3);
14988 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
14991 if (likely(!__pyx_t_8)) {
14992 if (likely(PyList_CheckExact(__pyx_t_3))) {
14993 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
14994 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14995 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14997 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14998 __Pyx_GOTREF(__pyx_t_9);
15001 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15002 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15003 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15005 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15006 __Pyx_GOTREF(__pyx_t_9);
15010 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15011 if (unlikely(!__pyx_t_9)) {
15012 PyObject* exc_type = PyErr_Occurred();
15014 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15015 else __PYX_ERR(1, 748, __pyx_L1_error)
15019 __Pyx_GOTREF(__pyx_t_9);
15021 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15023 __pyx_v_dim = __pyx_t_6;
15024 __pyx_t_6 = (__pyx_t_6 + 1);
15033 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
15034 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15044 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
15045 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
15054 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
15055 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
15074 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
15075 __pyx_t_2 = (__pyx_v_index == Py_None);
15076 __pyx_t_1 = (__pyx_t_2 != 0);
15086 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
15087 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15096 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
15097 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15106 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
15107 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15116 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
15117 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15136 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
15138 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15139 __Pyx_GOTREF(__pyx_t_9);
15140 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15142 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15144 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15145 __pyx_t_10 = __pyx_t_12;
15146 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15147 goto __pyx_L7_bool_binop_done;
15150 __pyx_L7_bool_binop_done:;
15151 __pyx_v_start = __pyx_t_10;
15160 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
15161 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
15162 __Pyx_GOTREF(__pyx_t_9);
15163 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
15165 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15167 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
15168 __pyx_t_10 = __pyx_t_12;
15169 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15170 goto __pyx_L9_bool_binop_done;
15173 __pyx_L9_bool_binop_done:;
15174 __pyx_v_stop = __pyx_t_10;
15183 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
15184 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15185 __Pyx_GOTREF(__pyx_t_9);
15186 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
15188 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15190 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
15191 __pyx_t_10 = __pyx_t_12;
15192 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15193 goto __pyx_L11_bool_binop_done;
15196 __pyx_L11_bool_binop_done:;
15197 __pyx_v_step = __pyx_t_10;
15206 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
15207 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15208 __Pyx_GOTREF(__pyx_t_9);
15209 __pyx_t_1 = (__pyx_t_9 != Py_None);
15210 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15211 __pyx_v_have_start = __pyx_t_1;
15220 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
15221 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
15222 __Pyx_GOTREF(__pyx_t_9);
15223 __pyx_t_1 = (__pyx_t_9 != Py_None);
15224 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15225 __pyx_v_have_stop = __pyx_t_1;
15234 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15235 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
15236 __Pyx_GOTREF(__pyx_t_9);
15237 __pyx_t_1 = (__pyx_t_9 != Py_None);
15238 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15239 __pyx_v_have_step = __pyx_t_1;
15248 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
15249 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
15258 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15259 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15270 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15281 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15282 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15283 __pyx_t_2 = (__pyx_t_1 != 0);
15293 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15294 __Pyx_XDECREF(((PyObject *)__pyx_r));
15303 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
15304 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
15313 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
15314 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
15323 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15324 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
15325 __Pyx_GOTREF(__pyx_t_3);
15326 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
15327 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15347 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15349 __Pyx_XDECREF(((PyObject *)__pyx_r));
15358 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
15359 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
15360 __Pyx_GOTREF(__pyx_t_3);
15369 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15370 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
15371 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15386 __Pyx_XDECREF(__pyx_t_3);
15387 __Pyx_XDECREF(__pyx_t_9);
15388 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15391 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15392 __Pyx_XDECREF(__pyx_v_index);
15393 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15394 __Pyx_TraceReturn(__pyx_r, 0);
15395 __Pyx_RefNannyFinishContext();
15407 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15408 Py_ssize_t __pyx_v_new_shape;
15409 int __pyx_v_negative_step;
15411 __Pyx_TraceDeclarations
15415 int __pyx_lineno = 0;
15416 const char *__pyx_filename = NULL;
15417 int __pyx_clineno = 0;
15418 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
15427 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15428 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15438 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15439 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15449 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15450 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15468 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
15469 __pyx_t_1 = (0 <= __pyx_v_start);
15471 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15473 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15483 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
15484 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
15512 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15514 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15517 __pyx_t_2 = __pyx_t_1;
15518 goto __pyx_L6_bool_binop_done;
15520 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15521 __pyx_t_2 = __pyx_t_1;
15522 __pyx_L6_bool_binop_done:;
15523 __pyx_v_negative_step = __pyx_t_2;
15532 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
15533 __pyx_t_1 = (__pyx_v_have_step != 0);
15536 __pyx_t_2 = __pyx_t_1;
15537 goto __pyx_L9_bool_binop_done;
15539 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15540 __pyx_t_2 = __pyx_t_1;
15541 __pyx_L9_bool_binop_done:;
15551 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
15552 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
15570 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15571 __pyx_t_2 = (__pyx_v_have_start != 0);
15581 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15582 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15592 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15593 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15602 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15603 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15613 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15642 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15643 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15653 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
15654 __pyx_t_2 = (__pyx_v_negative_step != 0);
15664 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15665 __pyx_v_start = (__pyx_v_shape - 1);
15684 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15686 __pyx_v_start = __pyx_v_shape;
15717 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15719 __pyx_t_2 = (__pyx_v_negative_step != 0);
15729 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15730 __pyx_v_start = (__pyx_v_shape - 1);
15749 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15764 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15765 __pyx_t_2 = (__pyx_v_have_stop != 0);
15775 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15776 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15786 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15787 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15796 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15797 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15807 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15836 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15837 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15847 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15848 __pyx_v_stop = __pyx_v_shape;
15877 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15879 __pyx_t_2 = (__pyx_v_negative_step != 0);
15889 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15890 __pyx_v_stop = -1L;
15909 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15911 __pyx_v_stop = __pyx_v_shape;
15924 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
15925 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15935 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
15954 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15963 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15973 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15991 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
15992 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16002 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
16003 __pyx_v_new_shape = 0;
16021 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
16022 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16031 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
16032 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16041 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
16042 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16053 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
16054 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16064 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
16065 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16084 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
16086 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16087 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16098 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
16099 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16109 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
16110 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16120 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
16121 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16131 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
16132 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16151 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
16161 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
16162 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
16183 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
16185 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16205 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
16221 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16223 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16225 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16230 __Pyx_TraceReturn(Py_None, 1);
16242 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16243 Py_ssize_t __pyx_v_shape;
16244 Py_ssize_t __pyx_v_stride;
16245 Py_ssize_t __pyx_v_suboffset;
16246 Py_ssize_t __pyx_v_itemsize;
16247 char *__pyx_v_resultp;
16249 __Pyx_TraceDeclarations
16250 __Pyx_RefNannyDeclarations
16251 Py_ssize_t __pyx_t_1;
16253 PyObject *__pyx_t_3 = NULL;
16254 PyObject *__pyx_t_4 = NULL;
16255 int __pyx_lineno = 0;
16256 const char *__pyx_filename = NULL;
16257 int __pyx_clineno = 0;
16258 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16259 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
16268 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
16269 __pyx_v_suboffset = -1L;
16278 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
16279 __pyx_t_1 = __pyx_v_view->itemsize;
16280 __pyx_v_itemsize = __pyx_t_1;
16289 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16290 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16300 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
16301 if (unlikely(__pyx_v_itemsize == 0)) {
16302 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16303 __PYX_ERR(1, 919, __pyx_L1_error)
16305 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16306 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16307 __PYX_ERR(1, 919, __pyx_L1_error)
16309 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16318 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16319 __pyx_v_stride = __pyx_v_itemsize;
16338 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16340 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16349 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16350 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16359 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
16360 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16370 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16371 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16391 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16392 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16402 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16403 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16412 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
16413 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16414 if (unlikely(__pyx_t_2)) {
16423 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16424 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16425 __Pyx_GOTREF(__pyx_t_3);
16426 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
16427 __Pyx_GOTREF(__pyx_t_4);
16428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16429 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16430 __Pyx_GOTREF(__pyx_t_3);
16431 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16432 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16433 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16434 __PYX_ERR(1, 930, __pyx_L1_error)
16461 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
16462 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16463 if (unlikely(__pyx_t_2)) {
16472 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16473 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16474 __Pyx_GOTREF(__pyx_t_3);
16475 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
16476 __Pyx_GOTREF(__pyx_t_4);
16477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16478 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16479 __Pyx_GOTREF(__pyx_t_3);
16480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16481 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16482 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16483 __PYX_ERR(1, 933, __pyx_L1_error)
16501 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16502 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16511 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
16512 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16522 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16523 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16541 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
16542 __pyx_r = __pyx_v_resultp;
16555 __Pyx_XDECREF(__pyx_t_3);
16556 __Pyx_XDECREF(__pyx_t_4);
16557 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16560 __Pyx_TraceReturn(Py_None, 0);
16561 __Pyx_RefNannyFinishContext();
16573 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16575 Py_ssize_t *__pyx_v_shape;
16576 Py_ssize_t *__pyx_v_strides;
16580 __Pyx_TraceDeclarations
16582 Py_ssize_t *__pyx_t_2;
16585 Py_ssize_t __pyx_t_5;
16586 Py_ssize_t __pyx_t_6;
16590 int __pyx_lineno = 0;
16591 const char *__pyx_filename = NULL;
16592 int __pyx_clineno = 0;
16593 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
16602 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16603 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16604 __pyx_v_ndim = __pyx_t_1;
16613 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
16614 __pyx_t_2 = __pyx_v_memslice->shape;
16615 __pyx_v_shape = __pyx_t_2;
16624 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
16625 __pyx_t_2 = __pyx_v_memslice->strides;
16626 __pyx_v_strides = __pyx_t_2;
16635 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16636 __pyx_t_3 = (__pyx_v_ndim / 2);
16637 __pyx_t_4 = __pyx_t_3;
16638 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16639 __pyx_v_i = __pyx_t_1;
16648 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16649 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16658 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
16659 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16660 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16661 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16662 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16671 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16672 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16673 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16674 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16675 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16684 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
16685 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16688 __pyx_t_7 = __pyx_t_8;
16689 goto __pyx_L6_bool_binop_done;
16691 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16692 __pyx_t_7 = __pyx_t_8;
16693 __pyx_L6_bool_binop_done:;
16703 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16704 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16723 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16739 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16741 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16743 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16748 __Pyx_TraceReturn(Py_None, 1);
16761 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16762 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16763 __Pyx_RefNannyDeclarations
16764 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16765 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16768 __Pyx_RefNannyFinishContext();
16771 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16772 __Pyx_TraceDeclarations
16773 __Pyx_RefNannyDeclarations
16774 int __pyx_lineno = 0;
16775 const char *__pyx_filename = NULL;
16776 int __pyx_clineno = 0;
16777 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16778 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16787 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16788 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16801 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16803 __Pyx_TraceReturn(Py_None, 0);
16804 __Pyx_RefNannyFinishContext();
16815 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16816 PyObject *__pyx_r = NULL;
16817 __Pyx_TraceDeclarations
16818 __Pyx_RefNannyDeclarations
16820 PyObject *__pyx_t_2 = NULL;
16821 int __pyx_lineno = 0;
16822 const char *__pyx_filename = NULL;
16823 int __pyx_clineno = 0;
16824 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16825 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16834 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16835 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16845 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16846 __Pyx_XDECREF(__pyx_r);
16847 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16848 __Pyx_GOTREF(__pyx_t_2);
16849 __pyx_r = __pyx_t_2;
16869 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16871 __Pyx_XDECREF(__pyx_r);
16872 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16873 __Pyx_GOTREF(__pyx_t_2);
16874 __pyx_r = __pyx_t_2;
16889 __Pyx_XDECREF(__pyx_t_2);
16890 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16893 __Pyx_XGIVEREF(__pyx_r);
16894 __Pyx_TraceReturn(__pyx_r, 0);
16895 __Pyx_RefNannyFinishContext();
16907 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16908 PyObject *__pyx_r = NULL;
16909 __Pyx_TraceDeclarations
16910 __Pyx_RefNannyDeclarations
16913 PyObject *__pyx_t_3 = NULL;
16914 int __pyx_lineno = 0;
16915 const char *__pyx_filename = NULL;
16916 int __pyx_clineno = 0;
16917 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16918 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
16927 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
16928 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16938 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16939 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
16958 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
16960 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
16961 __Pyx_GOTREF(__pyx_t_3);
16962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16975 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16978 __Pyx_XDECREF(__pyx_t_3);
16979 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16982 __Pyx_XGIVEREF(__pyx_r);
16983 __Pyx_TraceReturn(__pyx_r, 0);
16984 __Pyx_RefNannyFinishContext();
16997 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16998 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16999 PyObject *__pyx_r = 0;
17000 __Pyx_RefNannyDeclarations
17001 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17002 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17005 __Pyx_RefNannyFinishContext();
17009 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17010 PyObject *__pyx_r = NULL;
17011 __Pyx_TraceDeclarations
17012 __Pyx_RefNannyDeclarations
17013 int __pyx_lineno = 0;
17014 const char *__pyx_filename = NULL;
17015 int __pyx_clineno = 0;
17016 __Pyx_RefNannySetupContext(
"__get__", 0);
17017 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
17026 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
17027 __Pyx_XDECREF(__pyx_r);
17028 __Pyx_INCREF(__pyx_v_self->from_object);
17029 __pyx_r = __pyx_v_self->from_object;
17042 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17045 __Pyx_XGIVEREF(__pyx_r);
17046 __Pyx_TraceReturn(__pyx_r, 0);
17047 __Pyx_RefNannyFinishContext();
17058 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17059 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17060 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17061 PyObject *__pyx_r = 0;
17062 __Pyx_RefNannyDeclarations
17063 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17064 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17067 __Pyx_RefNannyFinishContext();
17071 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17072 PyObject *__pyx_r = NULL;
17073 __Pyx_TraceDeclarations
17074 __Pyx_RefNannyDeclarations
17075 PyObject *__pyx_t_1 = NULL;
17076 int __pyx_lineno = 0;
17077 const char *__pyx_filename = NULL;
17078 int __pyx_clineno = 0;
17079 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17080 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17088 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
17089 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17090 __Pyx_GOTREF(__pyx_t_1);
17091 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17093 __PYX_ERR(1, 2, __pyx_L1_error)
17103 __Pyx_XDECREF(__pyx_t_1);
17104 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17106 __Pyx_XGIVEREF(__pyx_r);
17107 __Pyx_TraceReturn(__pyx_r, 0);
17108 __Pyx_RefNannyFinishContext();
17120 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17121 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17122 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17123 PyObject *__pyx_r = 0;
17124 __Pyx_RefNannyDeclarations
17125 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17126 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17129 __Pyx_RefNannyFinishContext();
17133 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17134 PyObject *__pyx_r = NULL;
17135 __Pyx_TraceDeclarations
17136 __Pyx_RefNannyDeclarations
17137 PyObject *__pyx_t_1 = NULL;
17138 int __pyx_lineno = 0;
17139 const char *__pyx_filename = NULL;
17140 int __pyx_clineno = 0;
17141 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17142 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17149 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
17150 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17151 __Pyx_GOTREF(__pyx_t_1);
17152 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17154 __PYX_ERR(1, 4, __pyx_L1_error)
17165 __Pyx_XDECREF(__pyx_t_1);
17166 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17168 __Pyx_XGIVEREF(__pyx_r);
17169 __Pyx_TraceReturn(__pyx_r, 0);
17170 __Pyx_RefNannyFinishContext();
17182 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17183 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17184 Py_ssize_t __pyx_v_suboffset;
17185 PyObject *__pyx_v_length = NULL;
17186 PyObject *__pyx_r = NULL;
17187 __Pyx_TraceDeclarations
17188 __Pyx_RefNannyDeclarations
17190 PyObject *__pyx_t_2 = NULL;
17191 PyObject *__pyx_t_3 = NULL;
17192 __Pyx_TypeInfo *__pyx_t_4;
17193 Py_buffer __pyx_t_5;
17194 Py_ssize_t *__pyx_t_6;
17195 Py_ssize_t *__pyx_t_7;
17196 Py_ssize_t *__pyx_t_8;
17197 Py_ssize_t __pyx_t_9;
17198 int __pyx_lineno = 0;
17199 const char *__pyx_filename = NULL;
17200 int __pyx_clineno = 0;
17201 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17202 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
17211 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
17212 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17222 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
17223 __Pyx_XDECREF(__pyx_r);
17224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17243 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17244 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17245 __Pyx_GOTREF(__pyx_t_2);
17246 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
17247 __Pyx_GOTREF(__pyx_t_3);
17248 __Pyx_INCREF(Py_None);
17249 __Pyx_GIVEREF(Py_None);
17250 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17251 __Pyx_INCREF(__pyx_int_0);
17252 __Pyx_GIVEREF(__pyx_int_0);
17253 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17254 __Pyx_GIVEREF(__pyx_t_2);
17255 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17257 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17258 __Pyx_GOTREF(__pyx_t_2);
17259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17260 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17270 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
17271 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17280 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17281 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17290 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
17291 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
17292 __Pyx_GOTREF(__pyx_t_2);
17293 __Pyx_GIVEREF(__pyx_t_2);
17294 __Pyx_GOTREF(__pyx_v_result->from_object);
17295 __Pyx_DECREF(__pyx_v_result->from_object);
17296 __pyx_v_result->from_object = __pyx_t_2;
17306 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17307 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17308 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17317 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17318 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17319 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17328 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17329 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17338 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17339 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17348 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
17349 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17358 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17359 Py_INCREF(Py_None);
17368 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
17369 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17379 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17380 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17399 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17401 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17412 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
17413 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17422 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
17423 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17432 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17433 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17442 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17443 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17444 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17445 __pyx_t_6 = __pyx_t_8;
17446 __pyx_v_suboffset = (__pyx_t_6[0]);
17455 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17456 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17466 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
17467 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17476 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17477 goto __pyx_L6_break;
17497 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17498 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17499 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17508 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
17509 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17510 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17511 __pyx_t_6 = __pyx_t_8;
17512 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
17513 __Pyx_GOTREF(__pyx_t_2);
17514 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17524 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17525 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
17526 __Pyx_GOTREF(__pyx_t_2);
17527 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
17528 __Pyx_GOTREF(__pyx_t_3);
17529 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17530 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
17531 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17532 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17542 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
17543 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17552 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17553 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17562 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
17563 __Pyx_XDECREF(__pyx_r);
17564 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17565 __pyx_r = ((PyObject *)__pyx_v_result);
17578 __Pyx_XDECREF(__pyx_t_2);
17579 __Pyx_XDECREF(__pyx_t_3);
17580 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17583 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17584 __Pyx_XDECREF(__pyx_v_length);
17585 __Pyx_XGIVEREF(__pyx_r);
17586 __Pyx_TraceReturn(__pyx_r, 0);
17587 __Pyx_RefNannyFinishContext();
17599 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17600 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17601 __Pyx_memviewslice *__pyx_r;
17602 __Pyx_TraceDeclarations
17603 __Pyx_RefNannyDeclarations
17606 PyObject *__pyx_t_3 = NULL;
17607 int __pyx_lineno = 0;
17608 const char *__pyx_filename = NULL;
17609 int __pyx_clineno = 0;
17610 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17611 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
17620 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17621 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17622 __pyx_t_2 = (__pyx_t_1 != 0);
17632 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
17633 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
17634 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17635 __Pyx_INCREF(__pyx_t_3);
17636 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17646 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17647 __pyx_r = (&__pyx_v_obj->from_slice);
17666 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
17668 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17677 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
17678 __pyx_r = __pyx_v_mslice;
17692 __Pyx_XDECREF(__pyx_t_3);
17693 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17696 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17697 __Pyx_TraceReturn(Py_None, 0);
17698 __Pyx_RefNannyFinishContext();
17710 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17712 Py_ssize_t *__pyx_v_shape;
17713 Py_ssize_t *__pyx_v_strides;
17714 Py_ssize_t *__pyx_v_suboffsets;
17715 __Pyx_TraceDeclarations
17716 __Pyx_RefNannyDeclarations
17717 Py_ssize_t *__pyx_t_1;
17721 Py_ssize_t __pyx_t_5;
17722 int __pyx_lineno = 0;
17723 const char *__pyx_filename = NULL;
17724 int __pyx_clineno = 0;
17725 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17726 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17735 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17736 __pyx_t_1 = __pyx_v_memview->view.shape;
17737 __pyx_v_shape = __pyx_t_1;
17746 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17747 __pyx_t_1 = __pyx_v_memview->view.strides;
17748 __pyx_v_strides = __pyx_t_1;
17757 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17758 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17759 __pyx_v_suboffsets = __pyx_t_1;
17768 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17769 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17778 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17779 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17788 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17789 __pyx_t_2 = __pyx_v_memview->view.ndim;
17790 __pyx_t_3 = __pyx_t_2;
17791 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17792 __pyx_v_dim = __pyx_t_4;
17801 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17802 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17811 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17812 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17821 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17822 if ((__pyx_v_suboffsets != 0)) {
17823 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17827 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17841 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17843 __Pyx_TraceReturn(Py_None, 0);
17844 __Pyx_RefNannyFinishContext();
17855 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17856 __Pyx_memviewslice __pyx_v_memviewslice;
17857 PyObject *__pyx_r = NULL;
17858 __Pyx_TraceDeclarations
17859 __Pyx_RefNannyDeclarations
17860 PyObject *__pyx_t_1 = NULL;
17861 int __pyx_lineno = 0;
17862 const char *__pyx_filename = NULL;
17863 int __pyx_clineno = 0;
17864 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17865 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17874 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17875 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17884 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17885 __Pyx_XDECREF(__pyx_r);
17886 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17887 __Pyx_GOTREF(__pyx_t_1);
17888 __pyx_r = __pyx_t_1;
17902 __Pyx_XDECREF(__pyx_t_1);
17903 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17906 __Pyx_XGIVEREF(__pyx_r);
17907 __Pyx_TraceReturn(__pyx_r, 0);
17908 __Pyx_RefNannyFinishContext();
17920 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17921 PyObject *(*__pyx_v_to_object_func)(
char *);
17922 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17923 PyObject *__pyx_r = NULL;
17924 __Pyx_TraceDeclarations
17925 __Pyx_RefNannyDeclarations
17928 PyObject *(*__pyx_t_3)(
char *);
17929 int (*__pyx_t_4)(
char *, PyObject *);
17930 PyObject *__pyx_t_5 = NULL;
17931 int __pyx_lineno = 0;
17932 const char *__pyx_filename = NULL;
17933 int __pyx_clineno = 0;
17934 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17935 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
17944 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17945 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17946 __pyx_t_2 = (__pyx_t_1 != 0);
17956 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
17957 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17958 __pyx_v_to_object_func = __pyx_t_3;
17967 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17968 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17969 __pyx_v_to_dtype_func = __pyx_t_4;
17988 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
17990 __pyx_v_to_object_func = NULL;
17999 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
18000 __pyx_v_to_dtype_func = NULL;
18011 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
18012 __Pyx_XDECREF(__pyx_r);
18021 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
18022 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
18023 __Pyx_GOTREF(__pyx_t_5);
18024 __pyx_r = __pyx_t_5;
18038 __Pyx_XDECREF(__pyx_t_5);
18039 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18042 __Pyx_XGIVEREF(__pyx_r);
18043 __Pyx_TraceReturn(__pyx_r, 0);
18044 __Pyx_RefNannyFinishContext();
18056 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18057 Py_ssize_t __pyx_r;
18058 __Pyx_TraceDeclarations
18060 int __pyx_lineno = 0;
18061 const char *__pyx_filename = NULL;
18062 int __pyx_clineno = 0;
18063 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
18072 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
18073 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18083 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
18084 __pyx_r = (-__pyx_v_arg);
18103 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
18105 __pyx_r = __pyx_v_arg;
18119 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18122 __Pyx_TraceReturn(Py_None, 1);
18134 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18136 Py_ssize_t __pyx_v_c_stride;
18137 Py_ssize_t __pyx_v_f_stride;
18139 __Pyx_TraceDeclarations
18144 int __pyx_lineno = 0;
18145 const char *__pyx_filename = NULL;
18146 int __pyx_clineno = 0;
18147 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
18156 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
18157 __pyx_v_c_stride = 0;
18166 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
18167 __pyx_v_f_stride = 0;
18176 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
18177 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18178 __pyx_v_i = __pyx_t_1;
18187 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
18188 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18198 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
18199 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18208 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
18209 goto __pyx_L4_break;
18229 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18230 __pyx_t_1 = __pyx_v_ndim;
18231 __pyx_t_3 = __pyx_t_1;
18232 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18233 __pyx_v_i = __pyx_t_4;
18242 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18243 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18253 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
18254 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18263 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18264 goto __pyx_L7_break;
18284 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
18285 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18295 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18315 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
18331 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18334 __Pyx_TraceReturn(Py_None, 1);
18346 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18347 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18348 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18349 Py_ssize_t __pyx_v_dst_extent;
18350 Py_ssize_t __pyx_v_src_stride;
18351 Py_ssize_t __pyx_v_dst_stride;
18355 Py_ssize_t __pyx_t_4;
18356 Py_ssize_t __pyx_t_5;
18357 Py_ssize_t __pyx_t_6;
18366 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18375 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18384 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18393 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18402 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18412 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18415 __pyx_t_1 = __pyx_t_2;
18416 goto __pyx_L5_bool_binop_done;
18418 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18421 __pyx_t_1 = __pyx_t_2;
18422 goto __pyx_L5_bool_binop_done;
18432 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18434 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18436 __pyx_t_3 = (__pyx_t_2 != 0);
18437 __pyx_t_1 = __pyx_t_3;
18438 __pyx_L5_bool_binop_done:;
18456 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18476 __pyx_t_4 = __pyx_v_dst_extent;
18477 __pyx_t_5 = __pyx_t_4;
18478 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18479 __pyx_v_i = __pyx_t_6;
18488 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18497 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18506 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18529 __pyx_t_4 = __pyx_v_dst_extent;
18530 __pyx_t_5 = __pyx_t_4;
18531 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18532 __pyx_v_i = __pyx_t_6;
18541 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18550 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18559 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18583 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18584 __Pyx_TraceDeclarations
18585 int __pyx_lineno = 0;
18586 const char *__pyx_filename = NULL;
18587 int __pyx_clineno = 0;
18588 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
18597 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
18598 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18611 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18613 __Pyx_TraceReturn(Py_None, 1);
18624 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18625 Py_ssize_t __pyx_v_shape;
18626 Py_ssize_t __pyx_v_size;
18627 Py_ssize_t __pyx_r;
18628 __Pyx_TraceDeclarations
18629 Py_ssize_t __pyx_t_1;
18630 Py_ssize_t *__pyx_t_2;
18631 Py_ssize_t *__pyx_t_3;
18632 Py_ssize_t *__pyx_t_4;
18633 int __pyx_lineno = 0;
18634 const char *__pyx_filename = NULL;
18635 int __pyx_clineno = 0;
18636 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
18645 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18646 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18647 __pyx_v_size = __pyx_t_1;
18656 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
18657 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18658 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18659 __pyx_t_2 = __pyx_t_4;
18660 __pyx_v_shape = (__pyx_t_2[0]);
18669 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18670 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18680 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
18681 __pyx_r = __pyx_v_size;
18694 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18697 __Pyx_TraceReturn(Py_None, 1);
18709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18711 Py_ssize_t __pyx_r;
18712 __Pyx_TraceDeclarations
18717 int __pyx_lineno = 0;
18718 const char *__pyx_filename = NULL;
18719 int __pyx_clineno = 0;
18720 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18729 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18730 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18740 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18741 __pyx_t_2 = __pyx_v_ndim;
18742 __pyx_t_3 = __pyx_t_2;
18743 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18744 __pyx_v_idx = __pyx_t_4;
18753 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18754 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18763 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18764 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18784 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18786 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18787 __pyx_v_idx = __pyx_t_2;
18796 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18797 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18806 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18807 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18819 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18820 __pyx_r = __pyx_v_stride;
18833 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18836 __Pyx_TraceReturn(Py_None, 1);
18848 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18850 void *__pyx_v_result;
18851 size_t __pyx_v_itemsize;
18852 size_t __pyx_v_size;
18854 __Pyx_TraceDeclarations
18855 Py_ssize_t __pyx_t_1;
18858 struct __pyx_memoryview_obj *__pyx_t_4;
18861 int __pyx_lineno = 0;
18862 const char *__pyx_filename = NULL;
18863 int __pyx_clineno = 0;
18864 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18873 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18874 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18875 __pyx_v_itemsize = __pyx_t_1;
18884 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18885 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18894 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18895 __pyx_v_result = malloc(__pyx_v_size);
18904 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18905 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18915 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
18916 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
18934 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18935 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18944 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18945 __pyx_t_4 = __pyx_v_src->memview;
18946 __pyx_v_tmpslice->memview = __pyx_t_4;
18955 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18956 __pyx_t_3 = __pyx_v_ndim;
18957 __pyx_t_5 = __pyx_t_3;
18958 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18959 __pyx_v_i = __pyx_t_6;
18968 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
18969 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18978 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18979 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18989 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
18990 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18999 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
19000 __pyx_t_3 = __pyx_v_ndim;
19001 __pyx_t_5 = __pyx_t_3;
19002 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19003 __pyx_v_i = __pyx_t_6;
19012 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
19013 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19023 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
19024 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19043 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
19044 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19054 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
19055 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19074 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
19076 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19087 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
19088 __pyx_r = __pyx_v_result;
19103 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19105 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19107 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19112 __Pyx_TraceReturn(Py_None, 1);
19124 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19126 __Pyx_TraceDeclarations
19127 __Pyx_RefNannyDeclarations
19128 PyObject *__pyx_t_1 = NULL;
19129 PyObject *__pyx_t_2 = NULL;
19130 PyObject *__pyx_t_3 = NULL;
19131 PyObject *__pyx_t_4 = NULL;
19132 int __pyx_lineno = 0;
19133 const char *__pyx_filename = NULL;
19134 int __pyx_clineno = 0;
19136 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19138 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19139 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
19148 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
19149 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
19150 __Pyx_GOTREF(__pyx_t_1);
19151 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
19152 __Pyx_GOTREF(__pyx_t_2);
19153 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
19154 __Pyx_GOTREF(__pyx_t_3);
19155 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
19156 __Pyx_GOTREF(__pyx_t_4);
19157 __Pyx_GIVEREF(__pyx_t_1);
19158 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19159 __Pyx_GIVEREF(__pyx_t_2);
19160 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19161 __Pyx_GIVEREF(__pyx_t_3);
19162 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19174 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
19175 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
19176 __Pyx_GOTREF(__pyx_t_3);
19177 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19178 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
19179 __Pyx_GOTREF(__pyx_t_4);
19180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19181 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19182 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19183 __PYX_ERR(1, 1255, __pyx_L1_error)
19195 __Pyx_XDECREF(__pyx_t_1);
19196 __Pyx_XDECREF(__pyx_t_2);
19197 __Pyx_XDECREF(__pyx_t_3);
19198 __Pyx_XDECREF(__pyx_t_4);
19199 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19201 __Pyx_TraceReturn(Py_None, 0);
19202 __Pyx_RefNannyFinishContext();
19204 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19217 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19219 __Pyx_TraceDeclarations
19220 __Pyx_RefNannyDeclarations
19221 PyObject *__pyx_t_1 = NULL;
19222 PyObject *__pyx_t_2 = NULL;
19223 PyObject *__pyx_t_3 = NULL;
19224 PyObject *__pyx_t_4 = NULL;
19225 int __pyx_lineno = 0;
19226 const char *__pyx_filename = NULL;
19227 int __pyx_clineno = 0;
19229 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19231 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19232 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
19233 __Pyx_INCREF(__pyx_v_error);
19242 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
19243 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
19244 __Pyx_GOTREF(__pyx_t_2);
19245 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
19246 __Pyx_GOTREF(__pyx_t_3);
19247 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
19248 __Pyx_GOTREF(__pyx_t_4);
19249 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19250 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19251 __Pyx_INCREF(__pyx_v_error);
19252 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19253 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19254 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19255 if (likely(__pyx_t_2)) {
19256 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19257 __Pyx_INCREF(__pyx_t_2);
19258 __Pyx_INCREF(
function);
19259 __Pyx_DECREF_SET(__pyx_t_3,
function);
19262 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19263 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19264 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19265 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
19266 __Pyx_GOTREF(__pyx_t_1);
19267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19268 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19269 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19270 __PYX_ERR(1, 1260, __pyx_L1_error)
19282 __Pyx_XDECREF(__pyx_t_1);
19283 __Pyx_XDECREF(__pyx_t_2);
19284 __Pyx_XDECREF(__pyx_t_3);
19285 __Pyx_XDECREF(__pyx_t_4);
19286 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19288 __Pyx_XDECREF(__pyx_v_error);
19289 __Pyx_TraceReturn(Py_None, 0);
19290 __Pyx_RefNannyFinishContext();
19292 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19305 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19307 __Pyx_TraceDeclarations
19308 __Pyx_RefNannyDeclarations
19310 PyObject *__pyx_t_2 = NULL;
19311 PyObject *__pyx_t_3 = NULL;
19312 PyObject *__pyx_t_4 = NULL;
19313 PyObject *__pyx_t_5 = NULL;
19314 int __pyx_lineno = 0;
19315 const char *__pyx_filename = NULL;
19316 int __pyx_clineno = 0;
19318 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19320 __Pyx_RefNannySetupContext(
"_err", 0);
19321 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
19322 __Pyx_INCREF(__pyx_v_error);
19331 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
19332 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19333 if (unlikely(__pyx_t_1)) {
19342 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19343 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
19344 __Pyx_GOTREF(__pyx_t_3);
19345 __Pyx_INCREF(__pyx_v_error);
19346 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19347 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19348 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19349 if (likely(__pyx_t_5)) {
19350 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19351 __Pyx_INCREF(__pyx_t_5);
19352 __Pyx_INCREF(
function);
19353 __Pyx_DECREF_SET(__pyx_t_4,
function);
19356 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19357 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19358 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19359 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
19360 __Pyx_GOTREF(__pyx_t_2);
19361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19362 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19363 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19364 __PYX_ERR(1, 1265, __pyx_L1_error)
19382 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
19384 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19385 __PYX_ERR(1, 1267, __pyx_L1_error)
19398 __Pyx_XDECREF(__pyx_t_2);
19399 __Pyx_XDECREF(__pyx_t_3);
19400 __Pyx_XDECREF(__pyx_t_4);
19401 __Pyx_XDECREF(__pyx_t_5);
19402 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19404 __Pyx_XDECREF(__pyx_v_error);
19405 __Pyx_TraceReturn(Py_None, 0);
19406 __Pyx_RefNannyFinishContext();
19408 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19421 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19422 void *__pyx_v_tmpdata;
19423 size_t __pyx_v_itemsize;
19425 char __pyx_v_order;
19426 int __pyx_v_broadcasting;
19427 int __pyx_v_direct_copy;
19428 __Pyx_memviewslice __pyx_v_tmp;
19431 __Pyx_TraceDeclarations
19432 Py_ssize_t __pyx_t_1;
19440 int __pyx_lineno = 0;
19441 const char *__pyx_filename = NULL;
19442 int __pyx_clineno = 0;
19443 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
19452 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
19453 __pyx_v_tmpdata = NULL;
19462 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19463 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19464 __pyx_v_itemsize = __pyx_t_1;
19473 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19474 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19483 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
19484 __pyx_v_broadcasting = 0;
19493 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
19494 __pyx_v_direct_copy = 0;
19503 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19504 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19514 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19515 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19534 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
19535 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19545 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19546 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19565 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19566 __pyx_t_3 = __pyx_v_dst_ndim;
19567 __pyx_t_4 = __pyx_v_src_ndim;
19568 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19569 __pyx_t_5 = __pyx_t_3;
19571 __pyx_t_5 = __pyx_t_4;
19573 __pyx_v_ndim = __pyx_t_5;
19582 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19583 __pyx_t_5 = __pyx_v_ndim;
19584 __pyx_t_3 = __pyx_t_5;
19585 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19586 __pyx_v_i = __pyx_t_4;
19595 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19596 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19606 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19607 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19617 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
19618 __pyx_v_broadcasting = 1;
19627 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19628 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19647 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19649 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
19669 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
19670 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19680 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19681 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19700 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19701 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19711 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19712 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19722 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19723 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19741 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19742 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19743 __pyx_v_tmpdata = __pyx_t_7;
19752 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19753 __pyx_v_src = __pyx_v_tmp;
19771 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19772 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19782 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19783 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19793 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19794 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19813 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19814 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19824 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19825 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19844 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19845 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19855 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19856 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19865 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19866 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19875 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19876 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19885 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19886 free(__pyx_v_tmpdata);
19895 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19924 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
19925 __pyx_t_2 = (__pyx_v_order ==
'F');
19927 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19929 __pyx_t_8 = (__pyx_t_2 != 0);
19939 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
19940 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
19949 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19950 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
19968 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19969 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19978 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
19979 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19988 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19989 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19998 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
19999 free(__pyx_v_tmpdata);
20008 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
20024 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20026 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20028 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20033 __Pyx_TraceReturn(Py_None, 1);
20045 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20047 int __pyx_v_offset;
20048 __Pyx_TraceDeclarations
20052 int __pyx_lineno = 0;
20053 const char *__pyx_filename = NULL;
20054 int __pyx_clineno = 0;
20055 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
20064 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
20065 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20074 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
20075 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20076 __pyx_v_i = __pyx_t_1;
20085 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
20086 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20095 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
20096 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20105 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
20106 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20116 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
20117 __pyx_t_1 = __pyx_v_offset;
20118 __pyx_t_2 = __pyx_t_1;
20119 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20120 __pyx_v_i = __pyx_t_3;
20129 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
20130 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20139 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
20140 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20149 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
20150 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20164 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20166 __Pyx_TraceReturn(Py_None, 1);
20177 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20178 __Pyx_TraceDeclarations
20180 int __pyx_lineno = 0;
20181 const char *__pyx_filename = NULL;
20182 int __pyx_clineno = 0;
20183 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
20192 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
20193 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20203 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
20204 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20226 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20228 __Pyx_TraceReturn(Py_None, 1);
20239 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20240 __Pyx_TraceDeclarations
20241 __Pyx_RefNannyDeclarations
20242 int __pyx_lineno = 0;
20243 const char *__pyx_filename = NULL;
20244 int __pyx_clineno = 0;
20246 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20248 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20249 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
20258 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
20259 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20272 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20274 __Pyx_TraceReturn(Py_None, 0);
20275 __Pyx_RefNannyFinishContext();
20277 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20289 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20290 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20291 __Pyx_TraceDeclarations
20292 __Pyx_RefNannyDeclarations
20293 Py_ssize_t __pyx_t_1;
20294 Py_ssize_t __pyx_t_2;
20295 Py_ssize_t __pyx_t_3;
20297 int __pyx_lineno = 0;
20298 const char *__pyx_filename = NULL;
20299 int __pyx_clineno = 0;
20300 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20301 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
20310 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20311 __pyx_t_1 = (__pyx_v_shape[0]);
20312 __pyx_t_2 = __pyx_t_1;
20313 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20314 __pyx_v_i = __pyx_t_3;
20323 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20324 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20334 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
20335 __pyx_t_4 = (__pyx_v_inc != 0);
20345 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20346 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20365 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20367 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20388 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
20398 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20399 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20410 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
20411 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20425 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20427 __Pyx_TraceReturn(Py_None, 0);
20428 __Pyx_RefNannyFinishContext();
20439 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20440 __Pyx_TraceDeclarations
20441 int __pyx_lineno = 0;
20442 const char *__pyx_filename = NULL;
20443 int __pyx_clineno = 0;
20444 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
20453 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
20454 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20463 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20464 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20473 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
20474 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20487 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20489 __Pyx_TraceReturn(Py_None, 1);
20500 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20501 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20502 Py_ssize_t __pyx_v_stride;
20503 Py_ssize_t __pyx_v_extent;
20504 __Pyx_TraceDeclarations
20506 Py_ssize_t __pyx_t_2;
20507 Py_ssize_t __pyx_t_3;
20508 Py_ssize_t __pyx_t_4;
20509 int __pyx_lineno = 0;
20510 const char *__pyx_filename = NULL;
20511 int __pyx_clineno = 0;
20512 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
20521 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
20522 __pyx_v_stride = (__pyx_v_strides[0]);
20531 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20532 __pyx_v_extent = (__pyx_v_shape[0]);
20541 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20542 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20552 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20553 __pyx_t_2 = __pyx_v_extent;
20554 __pyx_t_3 = __pyx_t_2;
20555 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20556 __pyx_v_i = __pyx_t_4;
20565 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
20566 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20575 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20576 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20596 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
20598 __pyx_t_2 = __pyx_v_extent;
20599 __pyx_t_3 = __pyx_t_2;
20600 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20601 __pyx_v_i = __pyx_t_4;
20610 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20611 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20620 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
20621 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20637 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20639 __Pyx_TraceReturn(Py_None, 1);
20649 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20650 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20651 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20652 PyObject *__pyx_v___pyx_type = 0;
20653 long __pyx_v___pyx_checksum;
20654 PyObject *__pyx_v___pyx_state = 0;
20655 int __pyx_lineno = 0;
20656 const char *__pyx_filename = NULL;
20657 int __pyx_clineno = 0;
20658 PyObject *__pyx_r = 0;
20659 __Pyx_RefNannyDeclarations
20660 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20662 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20663 PyObject* values[3] = {0,0,0};
20664 if (unlikely(__pyx_kwds)) {
20665 Py_ssize_t kw_args;
20666 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20667 switch (pos_args) {
20668 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20669 CYTHON_FALLTHROUGH;
20670 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20671 CYTHON_FALLTHROUGH;
20672 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20673 CYTHON_FALLTHROUGH;
20675 default:
goto __pyx_L5_argtuple_error;
20677 kw_args = PyDict_Size(__pyx_kwds);
20678 switch (pos_args) {
20680 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20681 else goto __pyx_L5_argtuple_error;
20682 CYTHON_FALLTHROUGH;
20684 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20686 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20688 CYTHON_FALLTHROUGH;
20690 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20692 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20695 if (unlikely(kw_args > 0)) {
20696 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20698 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20699 goto __pyx_L5_argtuple_error;
20701 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20702 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20703 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20705 __pyx_v___pyx_type = values[0];
20706 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20707 __pyx_v___pyx_state = values[2];
20709 goto __pyx_L4_argument_unpacking_done;
20710 __pyx_L5_argtuple_error:;
20711 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20713 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20714 __Pyx_RefNannyFinishContext();
20716 __pyx_L4_argument_unpacking_done:;
20717 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20720 __Pyx_RefNannyFinishContext();
20724 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20725 PyObject *__pyx_v___pyx_PickleError = 0;
20726 PyObject *__pyx_v___pyx_result = 0;
20727 PyObject *__pyx_r = NULL;
20728 __Pyx_TraceDeclarations
20729 __Pyx_RefNannyDeclarations
20730 PyObject *__pyx_t_1 = NULL;
20733 PyObject *__pyx_t_4 = NULL;
20734 PyObject *__pyx_t_5 = NULL;
20735 PyObject *__pyx_t_6 = NULL;
20736 int __pyx_lineno = 0;
20737 const char *__pyx_filename = NULL;
20738 int __pyx_clineno = 0;
20739 __Pyx_TraceFrameInit(__pyx_codeobj__36)
20740 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20741 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20750 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20751 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20752 __Pyx_GOTREF(__pyx_t_1);
20753 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20754 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20755 __pyx_t_3 = (__pyx_t_2 != 0);
20765 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20766 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20767 __Pyx_GOTREF(__pyx_t_1);
20768 __Pyx_INCREF(__pyx_n_s_PickleError);
20769 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20770 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20771 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20772 __Pyx_GOTREF(__pyx_t_4);
20773 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20774 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20775 __Pyx_GOTREF(__pyx_t_1);
20776 __Pyx_INCREF(__pyx_t_1);
20777 __pyx_v___pyx_PickleError = __pyx_t_1;
20778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20788 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20789 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20790 __Pyx_GOTREF(__pyx_t_1);
20791 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20792 __Pyx_GOTREF(__pyx_t_5);
20793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20794 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20795 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20796 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20797 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20798 if (likely(__pyx_t_6)) {
20799 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20800 __Pyx_INCREF(__pyx_t_6);
20801 __Pyx_INCREF(
function);
20802 __Pyx_DECREF_SET(__pyx_t_1,
function);
20805 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20806 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20807 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20808 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20809 __Pyx_GOTREF(__pyx_t_4);
20810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20811 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20813 __PYX_ERR(1, 6, __pyx_L1_error)
20831 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20832 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20833 __Pyx_GOTREF(__pyx_t_1);
20835 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20836 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20837 if (likely(__pyx_t_5)) {
20838 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20839 __Pyx_INCREF(__pyx_t_5);
20840 __Pyx_INCREF(
function);
20841 __Pyx_DECREF_SET(__pyx_t_1,
function);
20844 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20845 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20846 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20847 __Pyx_GOTREF(__pyx_t_4);
20848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20849 __pyx_v___pyx_result = __pyx_t_4;
20859 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20860 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20861 __pyx_t_2 = (__pyx_t_3 != 0);
20871 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20872 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20873 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20874 __Pyx_GOTREF(__pyx_t_4);
20875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20893 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20894 __Pyx_XDECREF(__pyx_r);
20895 __Pyx_INCREF(__pyx_v___pyx_result);
20896 __pyx_r = __pyx_v___pyx_result;
20907 __Pyx_XDECREF(__pyx_t_1);
20908 __Pyx_XDECREF(__pyx_t_4);
20909 __Pyx_XDECREF(__pyx_t_5);
20910 __Pyx_XDECREF(__pyx_t_6);
20911 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20914 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20915 __Pyx_XDECREF(__pyx_v___pyx_result);
20916 __Pyx_XGIVEREF(__pyx_r);
20917 __Pyx_TraceReturn(__pyx_r, 0);
20918 __Pyx_RefNannyFinishContext();
20930 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20931 PyObject *__pyx_r = NULL;
20932 __Pyx_TraceDeclarations
20933 __Pyx_RefNannyDeclarations
20934 PyObject *__pyx_t_1 = NULL;
20936 Py_ssize_t __pyx_t_3;
20939 PyObject *__pyx_t_6 = NULL;
20940 PyObject *__pyx_t_7 = NULL;
20941 PyObject *__pyx_t_8 = NULL;
20942 int __pyx_lineno = 0;
20943 const char *__pyx_filename = NULL;
20944 int __pyx_clineno = 0;
20945 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20946 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20955 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20956 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20957 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20958 __PYX_ERR(1, 12, __pyx_L1_error)
20960 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20961 __Pyx_GOTREF(__pyx_t_1);
20962 __Pyx_GIVEREF(__pyx_t_1);
20963 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20964 __Pyx_DECREF(__pyx_v___pyx_result->name);
20965 __pyx_v___pyx_result->name = __pyx_t_1;
20974 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20975 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20976 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20977 __PYX_ERR(1, 13, __pyx_L1_error)
20979 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20980 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20983 __pyx_t_2 = __pyx_t_4;
20984 goto __pyx_L4_bool_binop_done;
20986 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20987 __pyx_t_5 = (__pyx_t_4 != 0);
20988 __pyx_t_2 = __pyx_t_5;
20989 __pyx_L4_bool_binop_done:;
20997 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20998 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20999 __Pyx_GOTREF(__pyx_t_6);
21000 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21001 __Pyx_GOTREF(__pyx_t_7);
21002 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21003 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21004 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21005 __PYX_ERR(1, 14, __pyx_L1_error)
21007 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21008 __Pyx_GOTREF(__pyx_t_6);
21010 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21011 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21012 if (likely(__pyx_t_8)) {
21013 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21014 __Pyx_INCREF(__pyx_t_8);
21015 __Pyx_INCREF(
function);
21016 __Pyx_DECREF_SET(__pyx_t_7,
function);
21019 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21020 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21021 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21022 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21023 __Pyx_GOTREF(__pyx_t_1);
21024 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21025 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21044 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21047 __Pyx_XDECREF(__pyx_t_1);
21048 __Pyx_XDECREF(__pyx_t_6);
21049 __Pyx_XDECREF(__pyx_t_7);
21050 __Pyx_XDECREF(__pyx_t_8);
21051 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21054 __Pyx_XGIVEREF(__pyx_r);
21055 __Pyx_TraceReturn(__pyx_r, 0);
21056 __Pyx_RefNannyFinishContext();
21059 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21061 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21062 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
21063 PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
21064 if (unlikely(!o))
return 0;
21065 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
21066 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21067 p->A_csr = Py_None; Py_INCREF(Py_None);
21068 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21069 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21070 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0))
goto bad;
21073 Py_DECREF(o); o = 0;
21077 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21078 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21079 #if CYTHON_USE_TP_FINALIZE
21080 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21081 if (PyObject_CallFinalizerFromDealloc(o))
return;
21084 PyObject_GC_UnTrack(o);
21085 Py_CLEAR(p->A_csr);
21086 Py_CLEAR(p->A_indices_copy);
21087 Py_CLEAR(p->A_index_pointer_copy);
21088 PyObject_GC_Track(o);
21089 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o);
else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21092 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v,
void *a) {
21094 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21095 e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix));
if (e)
return e;
21097 e = (*v)(p->A_csr, a);
if (e)
return e;
21099 if (p->A_indices_copy) {
21100 e = (*v)(p->A_indices_copy, a);
if (e)
return e;
21102 if (p->A_index_pointer_copy) {
21103 e = (*v)(p->A_index_pointer_copy, a);
if (e)
return e;
21108 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21110 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21111 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) {
if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); }
else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21112 tmp = ((PyObject*)p->A_csr);
21113 p->A_csr = Py_None; Py_INCREF(Py_None);
21115 tmp = ((PyObject*)p->A_indices_copy);
21116 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21118 tmp = ((PyObject*)p->A_index_pointer_copy);
21119 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21124 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
21125 {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
21126 {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
21127 {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
21128 {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
21129 {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
21130 {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
21131 {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
21132 {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
21133 {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
21134 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
21135 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
21139 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
21140 PyVarObject_HEAD_INIT(0, 0)
21141 "imate._c_linear_operator.py_c_matrix.pycMatrix",
21142 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix),
21144 __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21145 #
if PY_VERSION_HEX < 0x030800b4
21148 #
if PY_VERSION_HEX >= 0x030800b4
21153 #
if PY_MAJOR_VERSION < 3
21156 #
if PY_MAJOR_VERSION >= 3
21169 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21170 "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ",
21171 __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21172 __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21177 __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21187 __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21197 #
if PY_VERSION_HEX >= 0x030400a1
21200 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21203 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21206 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21210 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21212 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21213 struct __pyx_array_obj *p;
21215 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21216 o = (*t->tp_alloc)(t, 0);
21218 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21220 if (unlikely(!o))
return 0;
21221 p = ((
struct __pyx_array_obj *)o);
21222 p->__pyx_vtab = __pyx_vtabptr_array;
21223 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21224 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21225 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21228 Py_DECREF(o); o = 0;
21232 static void __pyx_tp_dealloc_array(PyObject *o) {
21233 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21234 #if CYTHON_USE_TP_FINALIZE
21235 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
21236 if (PyObject_CallFinalizerFromDealloc(o))
return;
21240 PyObject *etype, *eval, *etb;
21241 PyErr_Fetch(&etype, &eval, &etb);
21242 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21243 __pyx_array___dealloc__(o);
21244 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21245 PyErr_Restore(etype, eval, etb);
21248 Py_CLEAR(p->_format);
21249 (*Py_TYPE(o)->tp_free)(o);
21251 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21253 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21254 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21259 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21261 return __pyx_array___setitem__(o, i, v);
21264 PyErr_Format(PyExc_NotImplementedError,
21265 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21270 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21271 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21272 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21274 v = __pyx_array___getattr__(o, n);
21279 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21280 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21283 static PyMethodDef __pyx_methods_array[] = {
21284 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21285 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21286 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21290 static struct PyGetSetDef __pyx_getsets_array[] = {
21291 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21295 static PySequenceMethods __pyx_tp_as_sequence_array = {
21296 __pyx_array___len__,
21299 __pyx_sq_item_array,
21308 static PyMappingMethods __pyx_tp_as_mapping_array = {
21309 __pyx_array___len__,
21310 __pyx_array___getitem__,
21311 __pyx_mp_ass_subscript_array,
21314 static PyBufferProcs __pyx_tp_as_buffer_array = {
21315 #if PY_MAJOR_VERSION < 3
21318 #if PY_MAJOR_VERSION < 3
21321 #if PY_MAJOR_VERSION < 3
21324 #if PY_MAJOR_VERSION < 3
21327 __pyx_array_getbuffer,
21331 static PyTypeObject __pyx_type___pyx_array = {
21332 PyVarObject_HEAD_INIT(0, 0)
21333 "imate._c_linear_operator.py_c_matrix.array",
21334 sizeof(
struct __pyx_array_obj),
21336 __pyx_tp_dealloc_array,
21337 #
if PY_VERSION_HEX < 0x030800b4
21340 #
if PY_VERSION_HEX >= 0x030800b4
21345 #
if PY_MAJOR_VERSION < 3
21348 #
if PY_MAJOR_VERSION >= 3
21353 &__pyx_tp_as_sequence_array,
21354 &__pyx_tp_as_mapping_array,
21358 __pyx_tp_getattro_array,
21360 &__pyx_tp_as_buffer_array,
21361 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21369 __pyx_methods_array,
21371 __pyx_getsets_array,
21379 __pyx_tp_new_array,
21389 #
if PY_VERSION_HEX >= 0x030400a1
21392 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21395 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21398 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21403 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21404 struct __pyx_MemviewEnum_obj *p;
21406 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21407 o = (*t->tp_alloc)(t, 0);
21409 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21411 if (unlikely(!o))
return 0;
21412 p = ((
struct __pyx_MemviewEnum_obj *)o);
21413 p->name = Py_None; Py_INCREF(Py_None);
21417 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21418 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21419 #if CYTHON_USE_TP_FINALIZE
21420 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21421 if (PyObject_CallFinalizerFromDealloc(o))
return;
21424 PyObject_GC_UnTrack(o);
21426 (*Py_TYPE(o)->tp_free)(o);
21429 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
21431 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21433 e = (*v)(p->name, a);
if (e)
return e;
21438 static int __pyx_tp_clear_Enum(PyObject *o) {
21440 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21441 tmp = ((PyObject*)p->name);
21442 p->name = Py_None; Py_INCREF(Py_None);
21447 static PyMethodDef __pyx_methods_Enum[] = {
21448 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21449 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21453 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21454 PyVarObject_HEAD_INIT(0, 0)
21455 "imate._c_linear_operator.py_c_matrix.Enum",
21456 sizeof(
struct __pyx_MemviewEnum_obj),
21458 __pyx_tp_dealloc_Enum,
21459 #
if PY_VERSION_HEX < 0x030800b4
21462 #
if PY_VERSION_HEX >= 0x030800b4
21467 #
if PY_MAJOR_VERSION < 3
21470 #
if PY_MAJOR_VERSION >= 3
21473 __pyx_MemviewEnum___repr__,
21483 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21485 __pyx_tp_traverse_Enum,
21486 __pyx_tp_clear_Enum,
21491 __pyx_methods_Enum,
21499 __pyx_MemviewEnum___init__,
21511 #
if PY_VERSION_HEX >= 0x030400a1
21514 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21517 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21520 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21524 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21526 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21527 struct __pyx_memoryview_obj *p;
21529 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21530 o = (*t->tp_alloc)(t, 0);
21532 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21534 if (unlikely(!o))
return 0;
21535 p = ((
struct __pyx_memoryview_obj *)o);
21536 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21537 p->obj = Py_None; Py_INCREF(Py_None);
21538 p->_size = Py_None; Py_INCREF(Py_None);
21539 p->_array_interface = Py_None; Py_INCREF(Py_None);
21540 p->view.obj = NULL;
21541 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21544 Py_DECREF(o); o = 0;
21548 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21549 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21550 #if CYTHON_USE_TP_FINALIZE
21551 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21552 if (PyObject_CallFinalizerFromDealloc(o))
return;
21555 PyObject_GC_UnTrack(o);
21557 PyObject *etype, *eval, *etb;
21558 PyErr_Fetch(&etype, &eval, &etb);
21559 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21560 __pyx_memoryview___dealloc__(o);
21561 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21562 PyErr_Restore(etype, eval, etb);
21565 Py_CLEAR(p->_size);
21566 Py_CLEAR(p->_array_interface);
21567 (*Py_TYPE(o)->tp_free)(o);
21570 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
21572 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21574 e = (*v)(p->obj, a);
if (e)
return e;
21577 e = (*v)(p->_size, a);
if (e)
return e;
21579 if (p->_array_interface) {
21580 e = (*v)(p->_array_interface, a);
if (e)
return e;
21583 e = (*v)(p->view.obj, a);
if (e)
return e;
21588 static int __pyx_tp_clear_memoryview(PyObject *o) {
21590 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21591 tmp = ((PyObject*)p->obj);
21592 p->obj = Py_None; Py_INCREF(Py_None);
21594 tmp = ((PyObject*)p->_size);
21595 p->_size = Py_None; Py_INCREF(Py_None);
21597 tmp = ((PyObject*)p->_array_interface);
21598 p->_array_interface = Py_None; Py_INCREF(Py_None);
21600 Py_CLEAR(p->view.obj);
21603 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21605 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21606 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21611 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21613 return __pyx_memoryview___setitem__(o, i, v);
21616 PyErr_Format(PyExc_NotImplementedError,
21617 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21622 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21623 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21626 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21627 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21630 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21631 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21634 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21635 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21638 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21639 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21642 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21643 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21646 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21647 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21650 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21651 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21654 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21655 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21658 static PyMethodDef __pyx_methods_memoryview[] = {
21659 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21660 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21661 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21662 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21663 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21664 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21668 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21669 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21670 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21671 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21672 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21673 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21674 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21675 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21676 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21677 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21681 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21682 __pyx_memoryview___len__,
21685 __pyx_sq_item_memoryview,
21694 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21695 __pyx_memoryview___len__,
21696 __pyx_memoryview___getitem__,
21697 __pyx_mp_ass_subscript_memoryview,
21700 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21701 #if PY_MAJOR_VERSION < 3
21704 #if PY_MAJOR_VERSION < 3
21707 #if PY_MAJOR_VERSION < 3
21710 #if PY_MAJOR_VERSION < 3
21713 __pyx_memoryview_getbuffer,
21717 static PyTypeObject __pyx_type___pyx_memoryview = {
21718 PyVarObject_HEAD_INIT(0, 0)
21719 "imate._c_linear_operator.py_c_matrix.memoryview",
21720 sizeof(
struct __pyx_memoryview_obj),
21722 __pyx_tp_dealloc_memoryview,
21723 #
if PY_VERSION_HEX < 0x030800b4
21726 #
if PY_VERSION_HEX >= 0x030800b4
21731 #
if PY_MAJOR_VERSION < 3
21734 #
if PY_MAJOR_VERSION >= 3
21737 __pyx_memoryview___repr__,
21739 &__pyx_tp_as_sequence_memoryview,
21740 &__pyx_tp_as_mapping_memoryview,
21743 __pyx_memoryview___str__,
21746 &__pyx_tp_as_buffer_memoryview,
21747 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21749 __pyx_tp_traverse_memoryview,
21750 __pyx_tp_clear_memoryview,
21755 __pyx_methods_memoryview,
21757 __pyx_getsets_memoryview,
21765 __pyx_tp_new_memoryview,
21775 #
if PY_VERSION_HEX >= 0x030400a1
21778 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21781 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21784 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21788 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21790 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21791 struct __pyx_memoryviewslice_obj *p;
21792 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21793 if (unlikely(!o))
return 0;
21794 p = ((
struct __pyx_memoryviewslice_obj *)o);
21795 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21796 p->from_object = Py_None; Py_INCREF(Py_None);
21797 p->from_slice.memview = NULL;
21801 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21802 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21803 #if CYTHON_USE_TP_FINALIZE
21804 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21805 if (PyObject_CallFinalizerFromDealloc(o))
return;
21808 PyObject_GC_UnTrack(o);
21810 PyObject *etype, *eval, *etb;
21811 PyErr_Fetch(&etype, &eval, &etb);
21812 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21813 __pyx_memoryviewslice___dealloc__(o);
21814 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21815 PyErr_Restore(etype, eval, etb);
21817 Py_CLEAR(p->from_object);
21818 PyObject_GC_Track(o);
21819 __pyx_tp_dealloc_memoryview(o);
21822 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21824 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21825 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21826 if (p->from_object) {
21827 e = (*v)(p->from_object, a);
if (e)
return e;
21832 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21834 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21835 __pyx_tp_clear_memoryview(o);
21836 tmp = ((PyObject*)p->from_object);
21837 p->from_object = Py_None; Py_INCREF(Py_None);
21839 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21843 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21844 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21847 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21848 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21849 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21853 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21854 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21858 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21859 PyVarObject_HEAD_INIT(0, 0)
21860 "imate._c_linear_operator.py_c_matrix._memoryviewslice",
21861 sizeof(
struct __pyx_memoryviewslice_obj),
21863 __pyx_tp_dealloc__memoryviewslice,
21864 #
if PY_VERSION_HEX < 0x030800b4
21867 #
if PY_VERSION_HEX >= 0x030800b4
21872 #
if PY_MAJOR_VERSION < 3
21875 #
if PY_MAJOR_VERSION >= 3
21878 #
if CYTHON_COMPILING_IN_PYPY
21879 __pyx_memoryview___repr__,
21888 #
if CYTHON_COMPILING_IN_PYPY
21889 __pyx_memoryview___str__,
21896 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21897 "Internal class for passing memoryview slices to Python",
21898 __pyx_tp_traverse__memoryviewslice,
21899 __pyx_tp_clear__memoryviewslice,
21904 __pyx_methods__memoryviewslice,
21906 __pyx_getsets__memoryviewslice,
21914 __pyx_tp_new__memoryviewslice,
21924 #
if PY_VERSION_HEX >= 0x030400a1
21927 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21930 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21933 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21938 static PyMethodDef __pyx_methods[] = {
21942 #if PY_MAJOR_VERSION >= 3
21943 #if CYTHON_PEP489_MULTI_PHASE_INIT
21944 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
21945 static int __pyx_pymod_exec_py_c_matrix(PyObject* module);
21946 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21947 {Py_mod_create, (
void*)__pyx_pymod_create},
21948 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_matrix},
21953 static struct PyModuleDef __pyx_moduledef = {
21954 PyModuleDef_HEAD_INIT,
21957 #if CYTHON_PEP489_MULTI_PHASE_INIT
21963 #if CYTHON_PEP489_MULTI_PHASE_INIT
21964 __pyx_moduledef_slots,
21973 #ifndef CYTHON_SMALL_CODE
21974 #if defined(__clang__)
21975 #define CYTHON_SMALL_CODE
21976 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21977 #define CYTHON_SMALL_CODE __attribute__((cold))
21979 #define CYTHON_SMALL_CODE
21983 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21984 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
21985 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21986 {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None,
sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
21987 {&__pyx_n_s_A_data_double, __pyx_k_A_data_double,
sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
21988 {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv,
sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
21989 {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c,
sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
21990 {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f,
sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
21991 {&__pyx_n_s_A_data_float, __pyx_k_A_data_float,
sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
21992 {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv,
sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
21993 {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c,
sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
21994 {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f,
sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
21995 {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double,
sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
21996 {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv,
sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
21997 {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c,
sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
21998 {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f,
sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
21999 {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer,
sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
22000 {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv,
sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
22001 {&__pyx_n_s_A_indices, __pyx_k_A_indices,
sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
22002 {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv,
sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
22003 {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major,
sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
22004 {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns,
sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
22005 {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows,
sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
22006 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22007 {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS,
sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
22008 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22009 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22010 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22011 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22012 {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa,
sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
22013 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22014 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22015 {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS,
sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
22016 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
22017 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22018 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22019 {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen,
sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
22020 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22021 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22022 {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
22023 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22024 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22025 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22026 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22027 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22028 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22029 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22030 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22031 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22032 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22033 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22034 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
22035 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22036 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22037 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22038 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22039 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22040 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22041 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22042 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
22043 {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix,
sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
22044 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
22045 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22046 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
22047 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22048 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22049 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22050 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22051 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22052 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
22053 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
22054 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
22055 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22056 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22057 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22058 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22059 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22060 {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices,
sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
22061 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22062 {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
22063 {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
22064 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22065 {&__pyx_n_s_indices, __pyx_k_indices,
sizeof(__pyx_k_indices), 0, 0, 1, 1},
22066 {&__pyx_n_s_indptr, __pyx_k_indptr,
sizeof(__pyx_k_indptr), 0, 0, 1, 1},
22067 {&__pyx_n_s_issparse, __pyx_k_issparse,
sizeof(__pyx_k_issparse), 0, 0, 1, 1},
22068 {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc,
sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
22069 {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr,
sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
22070 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22071 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22072 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22073 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22074 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22075 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22076 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22077 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22078 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22079 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22080 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22081 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22082 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22083 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22084 {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix,
sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
22085 {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython,
sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
22086 {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython,
sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
22087 {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
22088 {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
22089 {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
22090 {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
22091 {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
22092 {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
22093 {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
22094 {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
22095 {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
22096 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22097 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22098 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22099 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22100 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22101 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22102 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22103 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22104 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22105 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22106 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22107 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22108 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
22109 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22110 {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double,
sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
22111 {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float,
sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
22112 {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double,
sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
22113 {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double,
sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
22114 {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float,
sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
22115 {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double,
sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
22116 {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double,
sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
22117 {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float,
sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
22118 {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double,
sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
22119 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22120 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22121 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22122 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22123 {&__pyx_n_s_sort_indices, __pyx_k_sort_indices,
sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
22124 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22125 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22126 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22127 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22128 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22129 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22130 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22131 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22132 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22133 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22134 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22135 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22136 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22137 {0, 0, 0, 0, 0, 0, 0}
22139 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22140 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
22141 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
22142 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
22143 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
22144 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
22145 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
22146 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
22147 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
22153 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22154 __Pyx_RefNannyDeclarations
22155 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22164 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
22165 __Pyx_GOTREF(__pyx_tuple_);
22166 __Pyx_GIVEREF(__pyx_tuple_);
22175 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
22176 __Pyx_GOTREF(__pyx_tuple__2);
22177 __Pyx_GIVEREF(__pyx_tuple__2);
22186 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
22187 __Pyx_GOTREF(__pyx_tuple__3);
22188 __Pyx_GIVEREF(__pyx_tuple__3);
22197 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
22198 __Pyx_GOTREF(__pyx_tuple__5);
22199 __Pyx_GIVEREF(__pyx_tuple__5);
22207 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22208 __Pyx_GOTREF(__pyx_tuple__15);
22209 __Pyx_GIVEREF(__pyx_tuple__15);
22216 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
22217 __Pyx_GOTREF(__pyx_tuple__17);
22218 __Pyx_GIVEREF(__pyx_tuple__17);
22227 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
22228 __Pyx_GOTREF(__pyx_tuple__18);
22229 __Pyx_GIVEREF(__pyx_tuple__18);
22238 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
22239 __Pyx_GOTREF(__pyx_tuple__19);
22240 __Pyx_GIVEREF(__pyx_tuple__19);
22249 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
22250 __Pyx_GOTREF(__pyx_tuple__20);
22251 __Pyx_GIVEREF(__pyx_tuple__20);
22260 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
22261 __Pyx_GOTREF(__pyx_tuple__21);
22262 __Pyx_GIVEREF(__pyx_tuple__21);
22271 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
22272 __Pyx_GOTREF(__pyx_tuple__22);
22273 __Pyx_GIVEREF(__pyx_tuple__22);
22281 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22282 __Pyx_GOTREF(__pyx_tuple__23);
22283 __Pyx_GIVEREF(__pyx_tuple__23);
22290 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22291 __Pyx_GOTREF(__pyx_tuple__24);
22292 __Pyx_GIVEREF(__pyx_tuple__24);
22301 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
22302 __Pyx_GOTREF(__pyx_tuple__25);
22303 __Pyx_GIVEREF(__pyx_tuple__25);
22312 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
22313 __Pyx_GOTREF(__pyx_tuple__26);
22314 __Pyx_GIVEREF(__pyx_tuple__26);
22323 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
22324 __Pyx_GOTREF(__pyx_tuple__27);
22325 __Pyx_GIVEREF(__pyx_tuple__27);
22334 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
22335 __Pyx_GOTREF(__pyx_tuple__28);
22336 __Pyx_GIVEREF(__pyx_tuple__28);
22345 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
22346 __Pyx_GOTREF(__pyx_tuple__29);
22347 __Pyx_INCREF(__pyx_int_neg_1);
22348 __Pyx_GIVEREF(__pyx_int_neg_1);
22349 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22350 __Pyx_GIVEREF(__pyx_tuple__29);
22358 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22359 __Pyx_GOTREF(__pyx_tuple__30);
22360 __Pyx_GIVEREF(__pyx_tuple__30);
22367 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22368 __Pyx_GOTREF(__pyx_tuple__31);
22369 __Pyx_GIVEREF(__pyx_tuple__31);
22378 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
22379 __Pyx_GOTREF(__pyx_slice__32);
22380 __Pyx_GIVEREF(__pyx_slice__32);
22389 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
22390 __Pyx_GOTREF(__pyx_tuple__33);
22391 __Pyx_GIVEREF(__pyx_tuple__33);
22399 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22400 __Pyx_GOTREF(__pyx_tuple__34);
22401 __Pyx_GIVEREF(__pyx_tuple__34);
22408 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22409 __Pyx_GOTREF(__pyx_tuple__35);
22410 __Pyx_GIVEREF(__pyx_tuple__35);
22411 __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
22412 __Pyx_GOTREF(__pyx_tuple__37);
22413 __Pyx_GIVEREF(__pyx_tuple__37);
22422 __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 216, __pyx_L1_error)
22423 __Pyx_GOTREF(__pyx_tuple__38);
22424 __Pyx_GIVEREF(__pyx_tuple__38);
22425 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22434 __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 272, __pyx_L1_error)
22435 __Pyx_GOTREF(__pyx_tuple__39);
22436 __Pyx_GIVEREF(__pyx_tuple__39);
22437 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22446 __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 328, __pyx_L1_error)
22447 __Pyx_GOTREF(__pyx_tuple__40);
22448 __Pyx_GIVEREF(__pyx_tuple__40);
22449 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22458 __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 384, __pyx_L1_error)
22459 __Pyx_GOTREF(__pyx_tuple__41);
22460 __Pyx_GIVEREF(__pyx_tuple__41);
22461 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22470 __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 431, __pyx_L1_error)
22471 __Pyx_GOTREF(__pyx_tuple__42);
22472 __Pyx_GIVEREF(__pyx_tuple__42);
22473 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22482 __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 478, __pyx_L1_error)
22483 __Pyx_GOTREF(__pyx_tuple__43);
22484 __Pyx_GIVEREF(__pyx_tuple__43);
22485 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22494 __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 525, __pyx_L1_error)
22495 __Pyx_GOTREF(__pyx_tuple__44);
22496 __Pyx_GIVEREF(__pyx_tuple__44);
22497 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22506 __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 572, __pyx_L1_error)
22507 __Pyx_GOTREF(__pyx_tuple__45);
22508 __Pyx_GIVEREF(__pyx_tuple__45);
22509 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22518 __pyx_tuple__46 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 619, __pyx_L1_error)
22519 __Pyx_GOTREF(__pyx_tuple__46);
22520 __Pyx_GIVEREF(__pyx_tuple__46);
22521 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22528 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
22529 __Pyx_GOTREF(__pyx_tuple__47);
22530 __Pyx_GIVEREF(__pyx_tuple__47);
22531 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22539 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 3, __pyx_L1_error)
22540 __Pyx_GOTREF(__pyx_tuple__48);
22541 __Pyx_GIVEREF(__pyx_tuple__48);
22542 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22551 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22552 __Pyx_GOTREF(__pyx_tuple__49);
22553 __Pyx_GIVEREF(__pyx_tuple__49);
22562 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22563 __Pyx_GOTREF(__pyx_tuple__50);
22564 __Pyx_GIVEREF(__pyx_tuple__50);
22573 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 289, __pyx_L1_error)
22574 __Pyx_GOTREF(__pyx_tuple__51);
22575 __Pyx_GIVEREF(__pyx_tuple__51);
22584 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22585 __Pyx_GOTREF(__pyx_tuple__52);
22586 __Pyx_GIVEREF(__pyx_tuple__52);
22595 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 293, __pyx_L1_error)
22596 __Pyx_GOTREF(__pyx_tuple__53);
22597 __Pyx_GIVEREF(__pyx_tuple__53);
22604 __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
22605 __Pyx_GOTREF(__pyx_tuple__54);
22606 __Pyx_GIVEREF(__pyx_tuple__54);
22607 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22608 __Pyx_RefNannyFinishContext();
22611 __Pyx_RefNannyFinishContext();
22615 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22617 __Pyx_init_assertions_enabled();
22619 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
22621 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22622 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22623 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22624 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22625 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22626 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22627 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22628 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22634 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22635 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22636 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22637 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22638 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22639 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22640 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22642 static int __Pyx_modinit_global_init_code(
void) {
22643 __Pyx_RefNannyDeclarations
22644 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22646 generic = Py_None; Py_INCREF(Py_None);
22647 strided = Py_None; Py_INCREF(Py_None);
22648 indirect = Py_None; Py_INCREF(Py_None);
22649 contiguous = Py_None; Py_INCREF(Py_None);
22650 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22651 __Pyx_RefNannyFinishContext();
22655 static int __Pyx_modinit_variable_export_code(
void) {
22656 __Pyx_RefNannyDeclarations
22657 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22659 __Pyx_RefNannyFinishContext();
22663 static int __Pyx_modinit_function_export_code(
void) {
22664 __Pyx_RefNannyDeclarations
22665 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22667 __Pyx_RefNannyFinishContext();
22671 static int __Pyx_modinit_type_init_code(
void) {
22672 __Pyx_RefNannyDeclarations
22673 PyObject *__pyx_t_1 = NULL;
22674 int __pyx_lineno = 0;
22675 const char *__pyx_filename = NULL;
22676 int __pyx_clineno = 0;
22677 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22679 __pyx_t_1 = PyImport_ImportModule(
"imate._c_linear_operator.py_c_linear_operator");
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22680 __Pyx_GOTREF(__pyx_t_1);
22681 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1,
"imate._c_linear_operator.py_c_linear_operator",
"pycLinearOperator",
sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36);
if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22682 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict);
if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22683 __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22684 __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22685 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22686 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22687 #if PY_VERSION_HEX < 0x030800B1
22688 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22690 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22691 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22693 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22694 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22695 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22696 __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22697 __pyx_vtabptr_array = &__pyx_vtable_array;
22698 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22699 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22700 #if PY_VERSION_HEX < 0x030800B1
22701 __pyx_type___pyx_array.tp_print = 0;
22703 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22704 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22705 __pyx_array_type = &__pyx_type___pyx_array;
22706 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22707 #if PY_VERSION_HEX < 0x030800B1
22708 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22710 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22711 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22713 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22714 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22715 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22716 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22717 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22718 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22719 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22720 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22721 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22722 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22723 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22724 #if PY_VERSION_HEX < 0x030800B1
22725 __pyx_type___pyx_memoryview.tp_print = 0;
22727 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22728 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22730 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22731 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22732 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22733 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22734 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22735 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22736 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22737 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22738 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22739 #if PY_VERSION_HEX < 0x030800B1
22740 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22742 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22743 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22745 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22746 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22747 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22749 __Pyx_RefNannyFinishContext();
22752 __Pyx_XDECREF(__pyx_t_1);
22753 __Pyx_RefNannyFinishContext();
22757 static int __Pyx_modinit_type_import_code(
void) {
22758 __Pyx_RefNannyDeclarations
22759 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22761 __Pyx_RefNannyFinishContext();
22765 static int __Pyx_modinit_variable_import_code(
void) {
22766 __Pyx_RefNannyDeclarations
22767 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22769 __Pyx_RefNannyFinishContext();
22773 static int __Pyx_modinit_function_import_code(
void) {
22774 __Pyx_RefNannyDeclarations
22775 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22777 __Pyx_RefNannyFinishContext();
22782 #ifndef CYTHON_NO_PYINIT_EXPORT
22783 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22784 #elif PY_MAJOR_VERSION < 3
22786 #define __Pyx_PyMODINIT_FUNC extern "C" void
22788 #define __Pyx_PyMODINIT_FUNC void
22792 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22794 #define __Pyx_PyMODINIT_FUNC PyObject *
22799 #if PY_MAJOR_VERSION < 3
22800 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void) CYTHON_SMALL_CODE;
22801 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void)
22803 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void) CYTHON_SMALL_CODE;
22804 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void)
22805 #if CYTHON_PEP489_MULTI_PHASE_INIT
22807 return PyModuleDef_Init(&__pyx_moduledef);
22809 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22810 #if PY_VERSION_HEX >= 0x030700A1
22811 static PY_INT64_T main_interpreter_id = -1;
22812 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22813 if (main_interpreter_id == -1) {
22814 main_interpreter_id = current_id;
22815 return (unlikely(current_id == -1)) ? -1 : 0;
22816 }
else if (unlikely(main_interpreter_id != current_id))
22818 static PyInterpreterState *main_interpreter = NULL;
22819 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22820 if (!main_interpreter) {
22821 main_interpreter = current_interpreter;
22822 }
else if (unlikely(main_interpreter != current_interpreter))
22827 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22832 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22833 PyObject *value = PyObject_GetAttrString(spec, from_name);
22835 if (likely(value)) {
22836 if (allow_none || value != Py_None) {
22837 result = PyDict_SetItemString(moddict, to_name, value);
22840 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22847 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22848 PyObject *module = NULL, *moddict, *modname;
22849 if (__Pyx_check_single_interpreter())
22852 return __Pyx_NewRef(__pyx_m);
22853 modname = PyObject_GetAttrString(spec,
"name");
22854 if (unlikely(!modname))
goto bad;
22855 module = PyModule_NewObject(modname);
22856 Py_DECREF(modname);
22857 if (unlikely(!module))
goto bad;
22858 moddict = PyModule_GetDict(module);
22859 if (unlikely(!moddict))
goto bad;
22860 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22861 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22862 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22863 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22866 Py_XDECREF(module);
22871 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22875 __Pyx_TraceDeclarations
22876 PyObject *__pyx_t_1 = NULL;
22877 PyObject *__pyx_t_2 = NULL;
22878 static PyThread_type_lock __pyx_t_3[8];
22879 int __pyx_lineno = 0;
22880 const char *__pyx_filename = NULL;
22881 int __pyx_clineno = 0;
22882 __Pyx_RefNannyDeclarations
22883 #if CYTHON_PEP489_MULTI_PHASE_INIT
22885 if (__pyx_m == __pyx_pyinit_module)
return 0;
22886 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22889 #elif PY_MAJOR_VERSION >= 3
22890 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22892 #if CYTHON_REFNANNY
22893 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22894 if (!__Pyx_RefNanny) {
22896 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22897 if (!__Pyx_RefNanny)
22898 Py_FatalError(
"failed to import 'refnanny' module");
22901 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22902 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22903 #ifdef __Pxy_PyFrame_Initialize_Offsets
22904 __Pxy_PyFrame_Initialize_Offsets();
22906 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22907 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22908 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22909 #ifdef __Pyx_CyFunction_USED
22910 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22912 #ifdef __Pyx_FusedFunction_USED
22913 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22915 #ifdef __Pyx_Coroutine_USED
22916 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22918 #ifdef __Pyx_Generator_USED
22919 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22921 #ifdef __Pyx_AsyncGen_USED
22922 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22924 #ifdef __Pyx_StopAsyncIteration_USED
22925 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22929 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22930 PyEval_InitThreads();
22933 #if CYTHON_PEP489_MULTI_PHASE_INIT
22934 __pyx_m = __pyx_pyinit_module;
22935 Py_INCREF(__pyx_m);
22937 #if PY_MAJOR_VERSION < 3
22938 __pyx_m = Py_InitModule4(
"py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22940 __pyx_m = PyModule_Create(&__pyx_moduledef);
22942 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22944 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22945 Py_INCREF(__pyx_d);
22946 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22947 Py_INCREF(__pyx_b);
22948 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22949 Py_INCREF(__pyx_cython_runtime);
22950 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22952 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22953 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22954 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22956 if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
22957 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22959 #if PY_MAJOR_VERSION >= 3
22961 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22962 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_matrix")) {
22963 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22968 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22970 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22972 (void)__Pyx_modinit_global_init_code();
22973 (void)__Pyx_modinit_variable_export_code();
22974 (void)__Pyx_modinit_function_export_code();
22975 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22976 (void)__Pyx_modinit_type_import_code();
22977 (void)__Pyx_modinit_variable_import_code();
22978 (void)__Pyx_modinit_function_import_code();
22980 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22981 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22983 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22992 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
22993 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
22994 __Pyx_GOTREF(__pyx_t_1);
22995 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23005 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
23006 __pyx_t_1 = PyList_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23007 __Pyx_GOTREF(__pyx_t_1);
23008 __Pyx_INCREF(__pyx_n_s_issparse);
23009 __Pyx_GIVEREF(__pyx_n_s_issparse);
23010 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
23011 __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
23012 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
23013 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
23014 __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
23015 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
23016 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
23017 __Pyx_INCREF(__pyx_n_s_csr_matrix);
23018 __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
23019 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
23020 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
23021 __Pyx_GOTREF(__pyx_t_2);
23022 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23023 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_t_1);
23025 if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23027 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23028 __Pyx_GOTREF(__pyx_t_1);
23029 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23031 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23032 __Pyx_GOTREF(__pyx_t_1);
23033 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23035 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23036 __Pyx_GOTREF(__pyx_t_1);
23037 if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23048 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
23049 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
23050 __Pyx_GOTREF(__pyx_t_2);
23051 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
23052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23053 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23062 __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
23063 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
23064 __Pyx_GOTREF(__pyx_t_2);
23065 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
23066 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23067 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23076 __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
23077 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
23078 __Pyx_GOTREF(__pyx_t_2);
23079 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
23080 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23081 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23090 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
23091 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
23092 __Pyx_GOTREF(__pyx_t_2);
23093 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
23094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23095 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23104 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
23105 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
23106 __Pyx_GOTREF(__pyx_t_2);
23107 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
23108 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23109 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23118 __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
23119 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
23120 __Pyx_GOTREF(__pyx_t_2);
23121 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
23122 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23123 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23132 __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
23133 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
23134 __Pyx_GOTREF(__pyx_t_2);
23135 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
23136 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23137 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23146 __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
23147 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
23148 __Pyx_GOTREF(__pyx_t_2);
23149 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
23150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23151 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23160 __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
23161 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
23162 __Pyx_GOTREF(__pyx_t_2);
23163 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
23164 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23165 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23172 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23173 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23174 __Pyx_GOTREF(__pyx_t_2);
23175 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23176 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23184 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
23185 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
23186 __Pyx_GOTREF(__pyx_t_2);
23187 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23195 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
23196 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23197 __Pyx_GOTREF(__pyx_t_2);
23198 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23199 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23208 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
23209 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
23210 __Pyx_GOTREF(__pyx_t_2);
23211 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
23212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23213 PyType_Modified(__pyx_array_type);
23222 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
23232 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
23242 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
23243 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
23244 __Pyx_GOTREF(__pyx_t_2);
23245 __Pyx_XGOTREF(
generic);
23246 __Pyx_DECREF_SET(
generic, __pyx_t_2);
23247 __Pyx_GIVEREF(__pyx_t_2);
23257 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23258 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23259 __Pyx_GOTREF(__pyx_t_2);
23260 __Pyx_XGOTREF(strided);
23261 __Pyx_DECREF_SET(strided, __pyx_t_2);
23262 __Pyx_GIVEREF(__pyx_t_2);
23272 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
23273 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
23274 __Pyx_GOTREF(__pyx_t_2);
23275 __Pyx_XGOTREF(indirect);
23276 __Pyx_DECREF_SET(indirect, __pyx_t_2);
23277 __Pyx_GIVEREF(__pyx_t_2);
23287 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23288 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23289 __Pyx_GOTREF(__pyx_t_2);
23290 __Pyx_XGOTREF(contiguous);
23291 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23292 __Pyx_GIVEREF(__pyx_t_2);
23302 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
23303 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
23304 __Pyx_GOTREF(__pyx_t_2);
23305 __Pyx_XGOTREF(indirect_contiguous);
23306 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23307 __Pyx_GIVEREF(__pyx_t_2);
23317 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
23327 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23328 __pyx_memoryview_thread_locks_used = 0;
23337 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
23338 __pyx_t_3[0] = PyThread_allocate_lock();
23339 __pyx_t_3[1] = PyThread_allocate_lock();
23340 __pyx_t_3[2] = PyThread_allocate_lock();
23341 __pyx_t_3[3] = PyThread_allocate_lock();
23342 __pyx_t_3[4] = PyThread_allocate_lock();
23343 __pyx_t_3[5] = PyThread_allocate_lock();
23344 __pyx_t_3[6] = PyThread_allocate_lock();
23345 __pyx_t_3[7] = PyThread_allocate_lock();
23346 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23355 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
23365 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
23375 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
23385 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
23395 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
23405 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
23415 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
23425 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
23426 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
23427 __Pyx_GOTREF(__pyx_t_2);
23428 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
23429 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23430 PyType_Modified(__pyx_memoryview_type);
23439 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
23449 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
23459 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
23469 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
23479 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
23489 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
23499 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
23509 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
23519 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
23529 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
23539 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
23540 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
23541 __Pyx_GOTREF(__pyx_t_2);
23542 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
23543 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23544 PyType_Modified(__pyx_memoryviewslice_type);
23553 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
23563 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
23573 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
23583 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
23593 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
23603 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
23613 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
23623 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
23633 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
23643 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
23653 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
23663 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23673 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
23683 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23693 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
23703 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
23713 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
23723 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
23733 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
23743 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
23753 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
23761 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23762 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23763 __Pyx_GOTREF(__pyx_t_2);
23764 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23774 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23776 __Pyx_TraceReturn(Py_None, 0);
23782 __Pyx_XDECREF(__pyx_t_1);
23783 __Pyx_XDECREF(__pyx_t_2);
23786 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23789 }
else if (!PyErr_Occurred()) {
23790 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_matrix");
23793 __Pyx_RefNannyFinishContext();
23794 #if CYTHON_PEP489_MULTI_PHASE_INIT
23795 return (__pyx_m != NULL) ? 0 : -1;
23796 #elif PY_MAJOR_VERSION >= 3
23805 #if CYTHON_REFNANNY
23806 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23807 PyObject *m = NULL, *p = NULL;
23809 m = PyImport_ImportModule(modname);
23811 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23813 r = PyLong_AsVoidPtr(p);
23817 return (__Pyx_RefNannyAPIStruct *)r;
23822 #if CYTHON_USE_TYPE_SLOTS
23823 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23824 PyTypeObject* tp = Py_TYPE(obj);
23825 if (likely(tp->tp_getattro))
23826 return tp->tp_getattro(obj, attr_name);
23827 #if PY_MAJOR_VERSION < 3
23828 if (likely(tp->tp_getattr))
23829 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23831 return PyObject_GetAttr(obj, attr_name);
23836 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23837 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23838 if (unlikely(!result)) {
23839 PyErr_Format(PyExc_NameError,
23840 #
if PY_MAJOR_VERSION >= 3
23841 "name '%U' is not defined", name);
23843 "name '%.200s' is not defined", PyString_AS_STRING(name));
23850 static void __Pyx_RaiseDoubleKeywordsError(
23851 const char* func_name,
23854 PyErr_Format(PyExc_TypeError,
23855 #
if PY_MAJOR_VERSION >= 3
23856 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23858 "%s() got multiple values for keyword argument '%s'", func_name,
23859 PyString_AsString(kw_name));
23864 static int __Pyx_ParseOptionalKeywords(
23866 PyObject **argnames[],
23868 PyObject *values[],
23869 Py_ssize_t num_pos_args,
23870 const char* function_name)
23872 PyObject *key = 0, *value = 0;
23873 Py_ssize_t pos = 0;
23875 PyObject*** first_kw_arg = argnames + num_pos_args;
23876 while (PyDict_Next(kwds, &pos, &key, &value)) {
23877 name = first_kw_arg;
23878 while (*name && (**name != key)) name++;
23880 values[name-argnames] = value;
23883 name = first_kw_arg;
23884 #if PY_MAJOR_VERSION < 3
23885 if (likely(PyString_Check(key))) {
23887 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23888 && _PyString_Eq(**name, key)) {
23889 values[name-argnames] = value;
23894 if (*name)
continue;
23896 PyObject*** argname = argnames;
23897 while (argname != first_kw_arg) {
23898 if ((**argname == key) || (
23899 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23900 && _PyString_Eq(**argname, key))) {
23901 goto arg_passed_twice;
23908 if (likely(PyUnicode_Check(key))) {
23910 int cmp = (**name == key) ? 0 :
23911 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23912 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23914 PyUnicode_Compare(**name, key);
23915 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23917 values[name-argnames] = value;
23922 if (*name)
continue;
23924 PyObject*** argname = argnames;
23925 while (argname != first_kw_arg) {
23926 int cmp = (**argname == key) ? 0 :
23927 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23928 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23930 PyUnicode_Compare(**argname, key);
23931 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23932 if (cmp == 0)
goto arg_passed_twice;
23937 goto invalid_keyword_type;
23939 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23941 goto invalid_keyword;
23946 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23948 invalid_keyword_type:
23949 PyErr_Format(PyExc_TypeError,
23950 "%.200s() keywords must be strings", function_name);
23953 PyErr_Format(PyExc_TypeError,
23954 #
if PY_MAJOR_VERSION < 3
23955 "%.200s() got an unexpected keyword argument '%.200s'",
23956 function_name, PyString_AsString(key));
23958 "%s() got an unexpected keyword argument '%U'",
23959 function_name, key);
23966 static void __Pyx_RaiseArgtupleInvalid(
23967 const char* func_name,
23969 Py_ssize_t num_min,
23970 Py_ssize_t num_max,
23971 Py_ssize_t num_found)
23973 Py_ssize_t num_expected;
23974 const char *more_or_less;
23975 if (num_found < num_min) {
23976 num_expected = num_min;
23977 more_or_less =
"at least";
23979 num_expected = num_max;
23980 more_or_less =
"at most";
23983 more_or_less =
"exactly";
23985 PyErr_Format(PyExc_TypeError,
23986 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23987 func_name, more_or_less, num_expected,
23988 (num_expected == 1) ?
"" :
"s", num_found);
23992 #if CYTHON_FAST_THREAD_STATE
23993 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23994 PyObject *tmp_type, *tmp_value, *tmp_tb;
23995 tmp_type = tstate->curexc_type;
23996 tmp_value = tstate->curexc_value;
23997 tmp_tb = tstate->curexc_traceback;
23998 tstate->curexc_type = type;
23999 tstate->curexc_value = value;
24000 tstate->curexc_traceback = tb;
24001 Py_XDECREF(tmp_type);
24002 Py_XDECREF(tmp_value);
24003 Py_XDECREF(tmp_tb);
24005 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24006 *type = tstate->curexc_type;
24007 *value = tstate->curexc_value;
24008 *tb = tstate->curexc_traceback;
24009 tstate->curexc_type = 0;
24010 tstate->curexc_value = 0;
24011 tstate->curexc_traceback = 0;
24017 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24018 PyFrameObject** frame,
24019 PyThreadState* tstate,
24020 const char *funcname,
24021 const char *srcfile,
24023 PyObject *type, *value, *traceback;
24025 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24026 if (*code == NULL) {
24027 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24028 if (*code == NULL)
return 0;
24030 *frame = PyFrame_New(
24036 if (*frame == NULL)
return 0;
24037 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24038 Py_INCREF(Py_None);
24039 (*frame)->f_trace = Py_None;
24041 #if PY_VERSION_HEX < 0x030400B1
24043 (*frame)->f_tstate = tstate;
24046 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24048 __Pyx_EnterTracing(tstate);
24049 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24051 if (tstate->c_tracefunc)
24052 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24053 if (retval && tstate->c_profilefunc)
24055 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24056 __Pyx_LeaveTracing(tstate);
24058 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24059 return __Pyx_IsTracing(tstate, 0, 0) && retval;
24063 Py_XDECREF(traceback);
24067 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
24068 PyCodeObject *py_code = 0;
24069 #if PY_MAJOR_VERSION >= 3
24070 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24071 if (likely(py_code)) {
24072 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24075 PyObject *py_srcfile = 0;
24076 PyObject *py_funcname = 0;
24077 py_funcname = PyString_FromString(funcname);
24078 if (unlikely(!py_funcname))
goto bad;
24079 py_srcfile = PyString_FromString(srcfile);
24080 if (unlikely(!py_srcfile))
goto bad;
24081 py_code = PyCode_New(
24085 CO_OPTIMIZED | CO_NEWLOCALS,
24098 Py_XDECREF(py_srcfile);
24099 Py_XDECREF(py_funcname);
24106 #if CYTHON_COMPILING_IN_CPYTHON
24107 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24109 ternaryfunc call = Py_TYPE(func)->tp_call;
24110 if (unlikely(!call))
24111 return PyObject_Call(func, arg, kw);
24112 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24114 result = (*call)(func, arg, kw);
24115 Py_LeaveRecursiveCall();
24116 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24119 "NULL result without error in PyObject_Call");
24126 #if PY_MAJOR_VERSION < 3
24127 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24128 CYTHON_UNUSED PyObject *cause) {
24129 __Pyx_PyThreadState_declare
24131 if (!value || value == Py_None)
24135 if (!tb || tb == Py_None)
24139 if (!PyTraceBack_Check(tb)) {
24140 PyErr_SetString(PyExc_TypeError,
24141 "raise: arg 3 must be a traceback or None");
24145 if (PyType_Check(type)) {
24146 #if CYTHON_COMPILING_IN_PYPY
24148 Py_INCREF(Py_None);
24152 PyErr_NormalizeException(&type, &value, &tb);
24155 PyErr_SetString(PyExc_TypeError,
24156 "instance exception may not have a separate value");
24160 type = (PyObject*) Py_TYPE(type);
24162 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24163 PyErr_SetString(PyExc_TypeError,
24164 "raise: exception class must be a subclass of BaseException");
24168 __Pyx_PyThreadState_assign
24169 __Pyx_ErrRestore(type, value, tb);
24178 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24179 PyObject* owned_instance = NULL;
24180 if (tb == Py_None) {
24182 }
else if (tb && !PyTraceBack_Check(tb)) {
24183 PyErr_SetString(PyExc_TypeError,
24184 "raise: arg 3 must be a traceback or None");
24187 if (value == Py_None)
24189 if (PyExceptionInstance_Check(type)) {
24191 PyErr_SetString(PyExc_TypeError,
24192 "instance exception may not have a separate value");
24196 type = (PyObject*) Py_TYPE(value);
24197 }
else if (PyExceptionClass_Check(type)) {
24198 PyObject *instance_class = NULL;
24199 if (value && PyExceptionInstance_Check(value)) {
24200 instance_class = (PyObject*) Py_TYPE(value);
24201 if (instance_class != type) {
24202 int is_subclass = PyObject_IsSubclass(instance_class, type);
24203 if (!is_subclass) {
24204 instance_class = NULL;
24205 }
else if (unlikely(is_subclass == -1)) {
24208 type = instance_class;
24212 if (!instance_class) {
24215 args = PyTuple_New(0);
24216 else if (PyTuple_Check(value)) {
24220 args = PyTuple_Pack(1, value);
24223 owned_instance = PyObject_Call(type, args, NULL);
24225 if (!owned_instance)
24227 value = owned_instance;
24228 if (!PyExceptionInstance_Check(value)) {
24229 PyErr_Format(PyExc_TypeError,
24230 "calling %R should have returned an instance of "
24231 "BaseException, not %R",
24232 type, Py_TYPE(value));
24237 PyErr_SetString(PyExc_TypeError,
24238 "raise: exception class must be a subclass of BaseException");
24242 PyObject *fixed_cause;
24243 if (cause == Py_None) {
24244 fixed_cause = NULL;
24245 }
else if (PyExceptionClass_Check(cause)) {
24246 fixed_cause = PyObject_CallObject(cause, NULL);
24247 if (fixed_cause == NULL)
24249 }
else if (PyExceptionInstance_Check(cause)) {
24250 fixed_cause = cause;
24251 Py_INCREF(fixed_cause);
24253 PyErr_SetString(PyExc_TypeError,
24254 "exception causes must derive from "
24258 PyException_SetCause(value, fixed_cause);
24260 PyErr_SetObject(type, value);
24262 #if CYTHON_FAST_THREAD_STATE
24263 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24264 PyObject* tmp_tb = tstate->curexc_traceback;
24265 if (tb != tmp_tb) {
24267 tstate->curexc_traceback = tb;
24268 Py_XDECREF(tmp_tb);
24271 PyObject *tmp_type, *tmp_value, *tmp_tb;
24272 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24274 PyErr_Restore(tmp_type, tmp_value, tb);
24275 Py_XDECREF(tmp_tb);
24279 Py_XDECREF(owned_instance);
24285 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
24289 #if PY_MAJOR_VERSION < 3
24290 if (likely(PyInt_CheckExact(op1))) {
24291 const long b = intval;
24292 long a = PyInt_AS_LONG(op1);
24293 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24296 #if CYTHON_USE_PYLONG_INTERNALS
24297 if (likely(PyLong_CheckExact(op1))) {
24299 unsigned long uintval;
24300 Py_ssize_t size = Py_SIZE(op1);
24301 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24303 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24304 }
else if (intval < 0) {
24313 uintval = (
unsigned long) intval;
24314 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24315 if (uintval >> (PyLong_SHIFT * 4)) {
24316 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24317 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24320 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24321 if (uintval >> (PyLong_SHIFT * 3)) {
24322 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24323 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24326 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24327 if (uintval >> (PyLong_SHIFT * 2)) {
24328 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24329 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24332 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24333 if (uintval >> (PyLong_SHIFT * 1)) {
24334 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24335 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24338 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
24339 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24342 if (PyFloat_CheckExact(op1)) {
24343 const long b = intval;
24344 double a = PyFloat_AS_DOUBLE(op1);
24345 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24348 PyObject_RichCompare(op1, op2, Py_NE));
24352 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24353 #if CYTHON_COMPILING_IN_PYPY
24354 return PyObject_RichCompareBool(s1, s2, equals);
24357 return (equals == Py_EQ);
24358 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24359 const char *ps1, *ps2;
24360 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24361 if (length != PyBytes_GET_SIZE(s2))
24362 return (equals == Py_NE);
24363 ps1 = PyBytes_AS_STRING(s1);
24364 ps2 = PyBytes_AS_STRING(s2);
24365 if (ps1[0] != ps2[0]) {
24366 return (equals == Py_NE);
24367 }
else if (length == 1) {
24368 return (equals == Py_EQ);
24371 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24372 Py_hash_t hash1, hash2;
24373 hash1 = ((PyBytesObject*)s1)->ob_shash;
24374 hash2 = ((PyBytesObject*)s2)->ob_shash;
24375 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24376 return (equals == Py_NE);
24379 result = memcmp(ps1, ps2, (
size_t)length);
24380 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24382 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24383 return (equals == Py_NE);
24384 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24385 return (equals == Py_NE);
24388 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24391 result = __Pyx_PyObject_IsTrue(py_result);
24392 Py_DECREF(py_result);
24399 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24400 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24401 PyObject *dict = Py_TYPE(obj)->tp_dict;
24402 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24404 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24405 PyObject **dictptr = NULL;
24406 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24408 #if CYTHON_COMPILING_IN_CPYTHON
24409 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24411 dictptr = _PyObject_GetDictPtr(obj);
24414 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24416 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24417 PyObject *dict = Py_TYPE(obj)->tp_dict;
24418 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24420 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24425 #if CYTHON_USE_DICT_VERSIONS
24426 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24428 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24432 #if !CYTHON_AVOID_BORROWED_REFS
24433 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24434 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24435 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24436 if (likely(result)) {
24437 return __Pyx_NewRef(result);
24438 }
else if (unlikely(PyErr_Occurred())) {
24442 result = PyDict_GetItem(__pyx_d, name);
24443 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24444 if (likely(result)) {
24445 return __Pyx_NewRef(result);
24449 result = PyObject_GetItem(__pyx_d, name);
24450 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24451 if (likely(result)) {
24452 return __Pyx_NewRef(result);
24456 return __Pyx_GetBuiltinName(name);
24460 #if CYTHON_FAST_PYCCALL
24461 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24462 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24463 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24464 PyObject *
self = PyCFunction_GET_SELF(func);
24465 int flags = PyCFunction_GET_FLAGS(func);
24466 assert(PyCFunction_Check(func));
24467 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24468 assert(nargs >= 0);
24469 assert(nargs == 0 || args != NULL);
24473 assert(!PyErr_Occurred());
24474 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24475 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24477 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24483 #if CYTHON_FAST_PYCALL
24484 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24485 PyObject *globals) {
24487 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24488 PyObject **fastlocals;
24491 assert(globals != NULL);
24496 assert(tstate != NULL);
24497 f = PyFrame_New(tstate, co, globals, NULL);
24501 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24502 for (i = 0; i < na; i++) {
24504 fastlocals[i] = *args++;
24506 result = PyEval_EvalFrameEx(f,0);
24507 ++tstate->recursion_depth;
24509 --tstate->recursion_depth;
24512 #if 1 || PY_VERSION_HEX < 0x030600B1
24513 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24514 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24515 PyObject *globals = PyFunction_GET_GLOBALS(func);
24516 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24518 #if PY_MAJOR_VERSION >= 3
24521 PyObject *kwtuple, **k;
24526 assert(kwargs == NULL || PyDict_Check(kwargs));
24527 nk = kwargs ? PyDict_Size(kwargs) : 0;
24528 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24532 #
if PY_MAJOR_VERSION >= 3
24533 co->co_kwonlyargcount == 0 &&
24535 likely(kwargs == NULL || nk == 0) &&
24536 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24537 if (argdefs == NULL && co->co_argcount == nargs) {
24538 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24541 else if (nargs == 0 && argdefs != NULL
24542 && co->co_argcount == Py_SIZE(argdefs)) {
24545 args = &PyTuple_GET_ITEM(argdefs, 0);
24546 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24550 if (kwargs != NULL) {
24552 kwtuple = PyTuple_New(2 * nk);
24553 if (kwtuple == NULL) {
24557 k = &PyTuple_GET_ITEM(kwtuple, 0);
24559 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24570 closure = PyFunction_GET_CLOSURE(func);
24571 #if PY_MAJOR_VERSION >= 3
24572 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24574 if (argdefs != NULL) {
24575 d = &PyTuple_GET_ITEM(argdefs, 0);
24576 nd = Py_SIZE(argdefs);
24582 #if PY_MAJOR_VERSION >= 3
24583 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24586 d, (
int)nd, kwdefs, closure);
24588 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24591 d, (
int)nd, closure);
24593 Py_XDECREF(kwtuple);
24595 Py_LeaveRecursiveCall();
24602 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24603 PyObject *args, *result = NULL;
24604 #if CYTHON_FAST_PYCALL
24605 if (PyFunction_Check(
function)) {
24606 PyObject *args[2] = {arg1, arg2};
24607 return __Pyx_PyFunction_FastCall(
function, args, 2);
24610 #if CYTHON_FAST_PYCCALL
24611 if (__Pyx_PyFastCFunction_Check(
function)) {
24612 PyObject *args[2] = {arg1, arg2};
24613 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24616 args = PyTuple_New(2);
24617 if (unlikely(!args))
goto done;
24619 PyTuple_SET_ITEM(args, 0, arg1);
24621 PyTuple_SET_ITEM(args, 1, arg2);
24622 Py_INCREF(
function);
24623 result = __Pyx_PyObject_Call(
function, args, NULL);
24625 Py_DECREF(
function);
24631 #if CYTHON_COMPILING_IN_CPYTHON
24632 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24633 PyObject *
self, *result;
24635 cfunc = PyCFunction_GET_FUNCTION(func);
24636 self = PyCFunction_GET_SELF(func);
24637 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24639 result = cfunc(
self, arg);
24640 Py_LeaveRecursiveCall();
24641 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24644 "NULL result without error in PyObject_Call");
24651 #if CYTHON_COMPILING_IN_CPYTHON
24652 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24654 PyObject *args = PyTuple_New(1);
24655 if (unlikely(!args))
return NULL;
24657 PyTuple_SET_ITEM(args, 0, arg);
24658 result = __Pyx_PyObject_Call(func, args, NULL);
24662 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24663 #if CYTHON_FAST_PYCALL
24664 if (PyFunction_Check(func)) {
24665 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24668 if (likely(PyCFunction_Check(func))) {
24669 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24670 return __Pyx_PyObject_CallMethO(func, arg);
24671 #if CYTHON_FAST_PYCCALL
24672 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24673 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24677 return __Pyx__PyObject_CallOneArg(func, arg);
24680 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24682 PyObject *args = PyTuple_Pack(1, arg);
24683 if (unlikely(!args))
return NULL;
24684 result = __Pyx_PyObject_Call(func, args, NULL);
24691 #if CYTHON_COMPILING_IN_CPYTHON
24692 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24693 #if CYTHON_FAST_PYCALL
24694 if (PyFunction_Check(func)) {
24695 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24698 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
24699 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24701 if (likely(PyCFunction_Check(func)))
24704 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24705 return __Pyx_PyObject_CallMethO(func, NULL);
24708 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24713 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24715 if (!j)
return NULL;
24716 r = PyObject_GetItem(o, j);
24720 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24721 CYTHON_NCP_UNUSED
int wraparound,
24722 CYTHON_NCP_UNUSED
int boundscheck) {
24723 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24724 Py_ssize_t wrapped_i = i;
24725 if (wraparound & unlikely(i < 0)) {
24726 wrapped_i += PyList_GET_SIZE(o);
24728 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24729 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24733 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24735 return PySequence_GetItem(o, i);
24738 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24739 CYTHON_NCP_UNUSED
int wraparound,
24740 CYTHON_NCP_UNUSED
int boundscheck) {
24741 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24742 Py_ssize_t wrapped_i = i;
24743 if (wraparound & unlikely(i < 0)) {
24744 wrapped_i += PyTuple_GET_SIZE(o);
24746 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24747 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24751 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24753 return PySequence_GetItem(o, i);
24756 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24757 CYTHON_NCP_UNUSED
int wraparound,
24758 CYTHON_NCP_UNUSED
int boundscheck) {
24759 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24760 if (is_list || PyList_CheckExact(o)) {
24761 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24762 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24763 PyObject *r = PyList_GET_ITEM(o, n);
24768 else if (PyTuple_CheckExact(o)) {
24769 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24770 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24771 PyObject *r = PyTuple_GET_ITEM(o, n);
24776 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24777 if (likely(m && m->sq_item)) {
24778 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24779 Py_ssize_t l = m->sq_length(o);
24780 if (likely(l >= 0)) {
24783 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24788 return m->sq_item(o, i);
24792 if (is_list || PySequence_Check(o)) {
24793 return PySequence_GetItem(o, i);
24796 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24800 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24801 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24803 value = PyDict_GetItemWithError(d, key);
24804 if (unlikely(!value)) {
24805 if (!PyErr_Occurred()) {
24806 if (unlikely(PyTuple_Check(key))) {
24807 PyObject* args = PyTuple_Pack(1, key);
24808 if (likely(args)) {
24809 PyErr_SetObject(PyExc_KeyError, args);
24813 PyErr_SetObject(PyExc_KeyError, key);
24825 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24827 __Pyx_memviewslice *memviewslice,
24828 int memview_is_new_reference)
24830 __Pyx_RefNannyDeclarations
24832 Py_buffer *buf = &memview->view;
24833 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24834 if (unlikely(memviewslice->memview || memviewslice->data)) {
24835 PyErr_SetString(PyExc_ValueError,
24836 "memviewslice is already initialized!");
24839 if (buf->strides) {
24840 for (i = 0; i < ndim; i++) {
24841 memviewslice->strides[i] = buf->strides[i];
24844 Py_ssize_t stride = buf->itemsize;
24845 for (i = ndim - 1; i >= 0; i--) {
24846 memviewslice->strides[i] = stride;
24847 stride *= buf->shape[i];
24850 for (i = 0; i < ndim; i++) {
24851 memviewslice->shape[i] = buf->shape[i];
24852 if (buf->suboffsets) {
24853 memviewslice->suboffsets[i] = buf->suboffsets[i];
24855 memviewslice->suboffsets[i] = -1;
24858 memviewslice->memview = memview;
24859 memviewslice->data = (
char *)buf->buf;
24860 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24861 Py_INCREF(memview);
24866 memviewslice->memview = 0;
24867 memviewslice->data = 0;
24870 __Pyx_RefNannyFinishContext();
24873 #ifndef Py_NO_RETURN
24874 #define Py_NO_RETURN
24876 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24879 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
24880 va_start(vargs, fmt);
24884 vsnprintf(msg, 200, fmt, vargs);
24886 Py_FatalError(msg);
24888 static CYTHON_INLINE
int
24889 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24890 PyThread_type_lock lock)
24893 PyThread_acquire_lock(lock, 1);
24894 result = (*acquisition_count)++;
24895 PyThread_release_lock(lock);
24898 static CYTHON_INLINE
int
24899 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24900 PyThread_type_lock lock)
24903 PyThread_acquire_lock(lock, 1);
24904 result = (*acquisition_count)--;
24905 PyThread_release_lock(lock);
24908 static CYTHON_INLINE
void
24909 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24912 struct __pyx_memoryview_obj *memview = memslice->memview;
24913 if (unlikely(!memview || (PyObject *) memview == Py_None))
24915 if (unlikely(__pyx_get_slice_count(memview) < 0))
24916 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24917 __pyx_get_slice_count(memview), lineno);
24918 first_time = __pyx_add_acquisition_count(memview) == 0;
24919 if (unlikely(first_time)) {
24921 Py_INCREF((PyObject *) memview);
24923 PyGILState_STATE _gilstate = PyGILState_Ensure();
24924 Py_INCREF((PyObject *) memview);
24925 PyGILState_Release(_gilstate);
24929 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24930 int have_gil,
int lineno) {
24932 struct __pyx_memoryview_obj *memview = memslice->memview;
24933 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24934 memslice->memview = NULL;
24937 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24938 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24939 __pyx_get_slice_count(memview), lineno);
24940 last_time = __pyx_sub_acquisition_count(memview) == 1;
24941 memslice->data = NULL;
24942 if (unlikely(last_time)) {
24944 Py_CLEAR(memslice->memview);
24946 PyGILState_STATE _gilstate = PyGILState_Ensure();
24947 Py_CLEAR(memslice->memview);
24948 PyGILState_Release(_gilstate);
24951 memslice->memview = NULL;
24956 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24958 if (unlikely(!type)) {
24959 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24963 #if PY_MAJOR_VERSION == 2
24964 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24968 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24970 PyErr_Format(PyExc_TypeError,
24971 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24972 name, type->tp_name, Py_TYPE(obj)->tp_name);
24977 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
24978 #if CYTHON_COMPILING_IN_PYPY
24979 return PyObject_RichCompareBool(s1, s2, equals);
24981 #if PY_MAJOR_VERSION < 3
24982 PyObject* owned_ref = NULL;
24984 int s1_is_unicode, s2_is_unicode;
24988 s1_is_unicode = PyUnicode_CheckExact(s1);
24989 s2_is_unicode = PyUnicode_CheckExact(s2);
24990 #if PY_MAJOR_VERSION < 3
24991 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24992 owned_ref = PyUnicode_FromObject(s2);
24993 if (unlikely(!owned_ref))
24997 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24998 owned_ref = PyUnicode_FromObject(s1);
24999 if (unlikely(!owned_ref))
25003 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25004 return __Pyx_PyBytes_Equals(s1, s2, equals);
25007 if (s1_is_unicode & s2_is_unicode) {
25010 void *data1, *data2;
25011 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25013 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25014 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25017 #if CYTHON_USE_UNICODE_INTERNALS
25019 Py_hash_t hash1, hash2;
25020 #if CYTHON_PEP393_ENABLED
25021 hash1 = ((PyASCIIObject*)s1)->hash;
25022 hash2 = ((PyASCIIObject*)s2)->hash;
25024 hash1 = ((PyUnicodeObject*)s1)->hash;
25025 hash2 = ((PyUnicodeObject*)s2)->hash;
25027 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25032 kind = __Pyx_PyUnicode_KIND(s1);
25033 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25036 data1 = __Pyx_PyUnicode_DATA(s1);
25037 data2 = __Pyx_PyUnicode_DATA(s2);
25038 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25040 }
else if (length == 1) {
25043 int result = memcmp(data1, data2, (
size_t)(length * kind));
25044 #if PY_MAJOR_VERSION < 3
25045 Py_XDECREF(owned_ref);
25047 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25049 }
else if ((s1 == Py_None) & s2_is_unicode) {
25051 }
else if ((s2 == Py_None) & s1_is_unicode) {
25055 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25056 #if PY_MAJOR_VERSION < 3
25057 Py_XDECREF(owned_ref);
25061 result = __Pyx_PyObject_IsTrue(py_result);
25062 Py_DECREF(py_result);
25066 #if PY_MAJOR_VERSION < 3
25067 Py_XDECREF(owned_ref);
25069 return (equals == Py_EQ);
25071 #if PY_MAJOR_VERSION < 3
25072 Py_XDECREF(owned_ref);
25074 return (equals == Py_NE);
25079 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25080 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25081 int full_traceback, CYTHON_UNUSED
int nogil) {
25082 PyObject *old_exc, *old_val, *old_tb;
25084 __Pyx_PyThreadState_declare
25086 PyGILState_STATE state;
25088 state = PyGILState_Ensure();
25089 else state = (PyGILState_STATE)0;
25091 __Pyx_PyThreadState_assign
25092 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25093 if (full_traceback) {
25094 Py_XINCREF(old_exc);
25095 Py_XINCREF(old_val);
25096 Py_XINCREF(old_tb);
25097 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25100 #if PY_MAJOR_VERSION < 3
25101 ctx = PyString_FromString(name);
25103 ctx = PyUnicode_FromString(name);
25105 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25107 PyErr_WriteUnraisable(Py_None);
25109 PyErr_WriteUnraisable(ctx);
25114 PyGILState_Release(state);
25119 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25120 #if CYTHON_USE_TYPE_SLOTS
25121 #if PY_MAJOR_VERSION >= 3
25122 if (likely(PyUnicode_Check(n)))
25124 if (likely(PyString_Check(n)))
25126 return __Pyx_PyObject_GetAttrStr(o, n);
25128 return PyObject_GetAttr(o, n);
25132 #if CYTHON_USE_TYPE_SLOTS
25133 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25134 PyObject *runerr = NULL;
25135 Py_ssize_t key_value;
25136 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25137 if (unlikely(!(m && m->sq_item))) {
25138 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25141 key_value = __Pyx_PyIndex_AsSsize_t(index);
25142 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25143 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25145 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25147 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25151 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25152 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25153 if (likely(m && m->mp_subscript)) {
25154 return m->mp_subscript(obj, key);
25156 return __Pyx_PyObject_GetIndex(obj, key);
25161 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25162 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25163 const char* encoding,
const char* errors,
25164 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
25166 if (unlikely((start < 0) | (stop < 0))) {
25167 size_t slen = strlen(cstring);
25168 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25169 PyErr_SetString(PyExc_OverflowError,
25170 "c-string too long to convert to Python");
25173 length = (Py_ssize_t) slen;
25182 if (unlikely(stop <= start))
25183 return __Pyx_NewRef(__pyx_empty_unicode);
25184 length = stop - start;
25187 return decode_func(cstring, length, errors);
25189 return PyUnicode_Decode(cstring, length, encoding, errors);
25194 #if CYTHON_FAST_THREAD_STATE
25195 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25197 n = PyTuple_GET_SIZE(tuple);
25198 #if PY_MAJOR_VERSION >= 3
25199 for (i=0; i<n; i++) {
25200 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25203 for (i=0; i<n; i++) {
25204 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25208 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25209 PyObject *exc_type = tstate->curexc_type;
25210 if (exc_type == err)
return 1;
25211 if (unlikely(!exc_type))
return 0;
25212 if (unlikely(PyTuple_Check(err)))
25213 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25214 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25219 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25220 __Pyx_PyThreadState_declare
25221 __Pyx_PyThreadState_assign
25222 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25224 __Pyx_PyErr_Clear();
25228 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25229 PyObject *r = __Pyx_GetAttr(o, n);
25230 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25234 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25235 PyErr_Format(PyExc_ValueError,
25236 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25240 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25241 PyErr_Format(PyExc_ValueError,
25242 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25243 index, (index == 1) ?
"" :
"s");
25247 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25248 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25252 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25253 if (unlikely(!type)) {
25254 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25257 if (likely(__Pyx_TypeCheck(obj, type)))
25259 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25260 Py_TYPE(obj)->tp_name, type->tp_name);
25265 #if CYTHON_USE_EXC_INFO_STACK
25266 static _PyErr_StackItem *
25267 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25269 _PyErr_StackItem *exc_info = tstate->exc_info;
25270 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25271 exc_info->previous_item != NULL)
25273 exc_info = exc_info->previous_item;
25280 #if CYTHON_FAST_THREAD_STATE
25281 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25282 #if CYTHON_USE_EXC_INFO_STACK
25283 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25284 *type = exc_info->exc_type;
25285 *value = exc_info->exc_value;
25286 *tb = exc_info->exc_traceback;
25288 *type = tstate->exc_type;
25289 *value = tstate->exc_value;
25290 *tb = tstate->exc_traceback;
25293 Py_XINCREF(*value);
25296 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25297 PyObject *tmp_type, *tmp_value, *tmp_tb;
25298 #if CYTHON_USE_EXC_INFO_STACK
25299 _PyErr_StackItem *exc_info = tstate->exc_info;
25300 tmp_type = exc_info->exc_type;
25301 tmp_value = exc_info->exc_value;
25302 tmp_tb = exc_info->exc_traceback;
25303 exc_info->exc_type = type;
25304 exc_info->exc_value = value;
25305 exc_info->exc_traceback = tb;
25307 tmp_type = tstate->exc_type;
25308 tmp_value = tstate->exc_value;
25309 tmp_tb = tstate->exc_traceback;
25310 tstate->exc_type = type;
25311 tstate->exc_value = value;
25312 tstate->exc_traceback = tb;
25314 Py_XDECREF(tmp_type);
25315 Py_XDECREF(tmp_value);
25316 Py_XDECREF(tmp_tb);
25321 #if CYTHON_FAST_THREAD_STATE
25322 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25324 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25327 PyObject *local_type, *local_value, *local_tb;
25328 #if CYTHON_FAST_THREAD_STATE
25329 PyObject *tmp_type, *tmp_value, *tmp_tb;
25330 local_type = tstate->curexc_type;
25331 local_value = tstate->curexc_value;
25332 local_tb = tstate->curexc_traceback;
25333 tstate->curexc_type = 0;
25334 tstate->curexc_value = 0;
25335 tstate->curexc_traceback = 0;
25337 PyErr_Fetch(&local_type, &local_value, &local_tb);
25339 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25340 #if CYTHON_FAST_THREAD_STATE
25341 if (unlikely(tstate->curexc_type))
25343 if (unlikely(PyErr_Occurred()))
25346 #if PY_MAJOR_VERSION >= 3
25348 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25352 Py_XINCREF(local_tb);
25353 Py_XINCREF(local_type);
25354 Py_XINCREF(local_value);
25355 *type = local_type;
25356 *value = local_value;
25358 #if CYTHON_FAST_THREAD_STATE
25359 #if CYTHON_USE_EXC_INFO_STACK
25361 _PyErr_StackItem *exc_info = tstate->exc_info;
25362 tmp_type = exc_info->exc_type;
25363 tmp_value = exc_info->exc_value;
25364 tmp_tb = exc_info->exc_traceback;
25365 exc_info->exc_type = local_type;
25366 exc_info->exc_value = local_value;
25367 exc_info->exc_traceback = local_tb;
25370 tmp_type = tstate->exc_type;
25371 tmp_value = tstate->exc_value;
25372 tmp_tb = tstate->exc_traceback;
25373 tstate->exc_type = local_type;
25374 tstate->exc_value = local_value;
25375 tstate->exc_traceback = local_tb;
25377 Py_XDECREF(tmp_type);
25378 Py_XDECREF(tmp_value);
25379 Py_XDECREF(tmp_tb);
25381 PyErr_SetExcInfo(local_type, local_value, local_tb);
25388 Py_XDECREF(local_type);
25389 Py_XDECREF(local_value);
25390 Py_XDECREF(local_tb);
25395 #if CYTHON_FAST_THREAD_STATE
25396 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25397 PyObject *tmp_type, *tmp_value, *tmp_tb;
25398 #if CYTHON_USE_EXC_INFO_STACK
25399 _PyErr_StackItem *exc_info = tstate->exc_info;
25400 tmp_type = exc_info->exc_type;
25401 tmp_value = exc_info->exc_value;
25402 tmp_tb = exc_info->exc_traceback;
25403 exc_info->exc_type = *type;
25404 exc_info->exc_value = *value;
25405 exc_info->exc_traceback = *tb;
25407 tmp_type = tstate->exc_type;
25408 tmp_value = tstate->exc_value;
25409 tmp_tb = tstate->exc_traceback;
25410 tstate->exc_type = *type;
25411 tstate->exc_value = *value;
25412 tstate->exc_traceback = *tb;
25415 *value = tmp_value;
25419 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25420 PyObject *tmp_type, *tmp_value, *tmp_tb;
25421 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25422 PyErr_SetExcInfo(*type, *value, *tb);
25424 *value = tmp_value;
25430 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25431 PyObject *empty_list = 0;
25432 PyObject *module = 0;
25433 PyObject *global_dict = 0;
25434 PyObject *empty_dict = 0;
25436 #if PY_MAJOR_VERSION < 3
25437 PyObject *py_import;
25438 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25445 empty_list = PyList_New(0);
25450 global_dict = PyModule_GetDict(__pyx_m);
25453 empty_dict = PyDict_New();
25457 #if PY_MAJOR_VERSION >= 3
25459 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25460 module = PyImport_ImportModuleLevelObject(
25461 name, global_dict, empty_dict, list, 1);
25463 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25472 #if PY_MAJOR_VERSION < 3
25473 PyObject *py_level = PyInt_FromLong(level);
25476 module = PyObject_CallFunctionObjArgs(py_import,
25477 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25478 Py_DECREF(py_level);
25480 module = PyImport_ImportModuleLevelObject(
25481 name, global_dict, empty_dict, list, level);
25486 #if PY_MAJOR_VERSION < 3
25487 Py_XDECREF(py_import);
25489 Py_XDECREF(empty_list);
25490 Py_XDECREF(empty_dict);
25495 #if CYTHON_COMPILING_IN_CPYTHON
25496 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25502 return b == &PyBaseObject_Type;
25504 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25506 if (a == b)
return 1;
25510 n = PyTuple_GET_SIZE(mro);
25511 for (i = 0; i < n; i++) {
25512 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25517 return __Pyx_InBases(a, b);
25519 #if PY_MAJOR_VERSION == 2
25520 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25521 PyObject *exception, *value, *tb;
25523 __Pyx_PyThreadState_declare
25524 __Pyx_PyThreadState_assign
25525 __Pyx_ErrFetch(&exception, &value, &tb);
25526 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25527 if (unlikely(res == -1)) {
25528 PyErr_WriteUnraisable(err);
25532 res = PyObject_IsSubclass(err, exc_type2);
25533 if (unlikely(res == -1)) {
25534 PyErr_WriteUnraisable(err);
25538 __Pyx_ErrRestore(exception, value, tb);
25542 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25543 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25545 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25550 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25552 assert(PyExceptionClass_Check(exc_type));
25553 n = PyTuple_GET_SIZE(tuple);
25554 #if PY_MAJOR_VERSION >= 3
25555 for (i=0; i<n; i++) {
25556 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25559 for (i=0; i<n; i++) {
25560 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25561 #if PY_MAJOR_VERSION < 3
25562 if (likely(exc_type == t))
return 1;
25564 if (likely(PyExceptionClass_Check(t))) {
25565 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25571 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25572 if (likely(err == exc_type))
return 1;
25573 if (likely(PyExceptionClass_Check(err))) {
25574 if (likely(PyExceptionClass_Check(exc_type))) {
25575 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25576 }
else if (likely(PyTuple_Check(exc_type))) {
25577 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25581 return PyErr_GivenExceptionMatches(err, exc_type);
25583 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25584 assert(PyExceptionClass_Check(exc_type1));
25585 assert(PyExceptionClass_Check(exc_type2));
25586 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25587 if (likely(PyExceptionClass_Check(err))) {
25588 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25590 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25595 #if !CYTHON_COMPILING_IN_PYPY
25596 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
25598 (void)zerodivision_check;
25599 #if PY_MAJOR_VERSION < 3
25600 if (likely(PyInt_CheckExact(op1))) {
25601 const long b = intval;
25603 long a = PyInt_AS_LONG(op1);
25604 x = (long)((
unsigned long)a + b);
25605 if (likely((x^a) >= 0 || (x^b) >= 0))
25606 return PyInt_FromLong(x);
25607 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25610 #if CYTHON_USE_PYLONG_INTERNALS
25611 if (likely(PyLong_CheckExact(op1))) {
25612 const long b = intval;
25614 #ifdef HAVE_LONG_LONG
25615 const PY_LONG_LONG llb = intval;
25616 PY_LONG_LONG lla, llx;
25618 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25619 const Py_ssize_t size = Py_SIZE(op1);
25620 if (likely(__Pyx_sst_abs(size) <= 1)) {
25621 a = likely(size) ? digits[0] : 0;
25622 if (size == -1) a = -a;
25626 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25627 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25629 #ifdef HAVE_LONG_LONG
25630 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25631 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25635 CYTHON_FALLTHROUGH;
25637 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25638 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25640 #ifdef HAVE_LONG_LONG
25641 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25642 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25646 CYTHON_FALLTHROUGH;
25648 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25649 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25651 #ifdef HAVE_LONG_LONG
25652 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25653 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25657 CYTHON_FALLTHROUGH;
25659 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25660 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25662 #ifdef HAVE_LONG_LONG
25663 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25664 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25668 CYTHON_FALLTHROUGH;
25670 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25671 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25673 #ifdef HAVE_LONG_LONG
25674 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25675 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25679 CYTHON_FALLTHROUGH;
25681 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25682 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25684 #ifdef HAVE_LONG_LONG
25685 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25686 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25690 CYTHON_FALLTHROUGH;
25691 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25695 return PyLong_FromLong(x);
25696 #ifdef HAVE_LONG_LONG
25699 return PyLong_FromLongLong(llx);
25705 if (PyFloat_CheckExact(op1)) {
25706 const long b = intval;
25707 double a = PyFloat_AS_DOUBLE(op1);
25709 PyFPE_START_PROTECT(
"add",
return NULL)
25710 result = ((double)a) + (double)b;
25711 PyFPE_END_PROTECT(result)
25712 return PyFloat_FromDouble(result);
25714 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25719 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25720 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25724 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25725 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25726 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25727 PyErr_Format(PyExc_ImportError,
25728 #
if PY_MAJOR_VERSION < 3
25729 "cannot import name %.230s", PyString_AS_STRING(name));
25731 "cannot import name %S", name);
25738 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25740 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25741 PyErr_SetString(PyExc_TypeError,
25742 "hasattr(): attribute name must be string");
25745 r = __Pyx_GetAttr(o, n);
25746 if (unlikely(!r)) {
25756 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25757 PyTypeObject* type = Py_TYPE(obj);
25758 while (type && type->tp_dealloc != current_tp_dealloc)
25759 type = type->tp_base;
25760 while (type && type->tp_dealloc == current_tp_dealloc)
25761 type = type->tp_base;
25763 type->tp_dealloc(obj);
25767 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse) {
25768 PyTypeObject* type = Py_TYPE(obj);
25769 while (type && type->tp_traverse != current_tp_traverse)
25770 type = type->tp_base;
25771 while (type && type->tp_traverse == current_tp_traverse)
25772 type = type->tp_base;
25773 if (type && type->tp_traverse)
25774 return type->tp_traverse(obj, v, a);
25779 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25780 PyTypeObject* type = Py_TYPE(obj);
25781 while (type && type->tp_clear != current_tp_clear)
25782 type = type->tp_base;
25783 while (type && type->tp_clear == current_tp_clear)
25784 type = type->tp_base;
25785 if (type && type->tp_clear)
25786 type->tp_clear(obj);
25790 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25791 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25792 PyErr_Format(PyExc_AttributeError,
25793 #
if PY_MAJOR_VERSION >= 3
25794 "'%.50s' object has no attribute '%U'",
25795 tp->tp_name, attr_name);
25797 "'%.50s' object has no attribute '%.400s'",
25798 tp->tp_name, PyString_AS_STRING(attr_name));
25802 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25804 PyTypeObject *tp = Py_TYPE(obj);
25805 if (unlikely(!PyString_Check(attr_name))) {
25806 return PyObject_GenericGetAttr(obj, attr_name);
25808 assert(!tp->tp_dictoffset);
25809 descr = _PyType_Lookup(tp, attr_name);
25810 if (unlikely(!descr)) {
25811 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25814 #if PY_MAJOR_VERSION < 3
25815 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25818 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25820 PyObject *res = f(descr, obj, (PyObject *)tp);
25830 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25831 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25832 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25833 return PyObject_GenericGetAttr(obj, attr_name);
25835 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25840 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
25841 #define __PYX_HAVE_RT_ImportType_0_29_36
25842 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module,
const char *module_name,
const char *class_name,
25843 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
25845 PyObject *result = 0;
25847 Py_ssize_t basicsize;
25848 Py_ssize_t itemsize;
25849 #ifdef Py_LIMITED_API
25850 PyObject *py_basicsize;
25851 PyObject *py_itemsize;
25853 result = PyObject_GetAttrString(module, class_name);
25856 if (!PyType_Check(result)) {
25857 PyErr_Format(PyExc_TypeError,
25858 "%.200s.%.200s is not a type object",
25859 module_name, class_name);
25862 #ifndef Py_LIMITED_API
25863 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25864 itemsize = ((PyTypeObject *)result)->tp_itemsize;
25866 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25869 basicsize = PyLong_AsSsize_t(py_basicsize);
25870 Py_DECREF(py_basicsize);
25872 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25874 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
25877 itemsize = PyLong_AsSsize_t(py_itemsize);
25878 Py_DECREF(py_itemsize);
25880 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
25884 if (size % alignment) {
25885 alignment = size % alignment;
25887 if (itemsize < (Py_ssize_t)alignment)
25888 itemsize = (Py_ssize_t)alignment;
25890 if ((
size_t)(basicsize + itemsize) < size) {
25891 PyErr_Format(PyExc_ValueError,
25892 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25893 "Expected %zd from C header, got %zd from PyObject",
25894 module_name, class_name, size, basicsize);
25897 if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (
size_t)basicsize != size) {
25898 PyErr_Format(PyExc_ValueError,
25899 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25900 "Expected %zd from C header, got %zd from PyObject",
25901 module_name, class_name, size, basicsize);
25904 else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (
size_t)basicsize > size) {
25905 PyOS_snprintf(warning,
sizeof(warning),
25906 "%s.%s size changed, may indicate binary incompatibility. "
25907 "Expected %zd from C header, got %zd from PyObject",
25908 module_name, class_name, size, basicsize);
25909 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25911 return (PyTypeObject *)result;
25913 Py_XDECREF(result);
25919 static void* __Pyx_GetVtable(PyObject *dict) {
25921 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
25924 #if PY_VERSION_HEX >= 0x02070000
25925 ptr = PyCapsule_GetPointer(ob, 0);
25927 ptr = PyCObject_AsVoidPtr(ob);
25929 if (!ptr && !PyErr_Occurred())
25930 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
25939 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25940 #if PY_VERSION_HEX >= 0x02070000
25941 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25943 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25947 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25957 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25958 __Pyx_PyThreadState_declare
25959 __Pyx_PyThreadState_assign
25960 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25961 __Pyx_PyErr_Clear();
25963 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25965 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25966 PyTypeObject* tp = Py_TYPE(obj);
25967 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25968 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25971 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25972 if (unlikely(!result)) {
25973 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25979 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25981 PyObject *name_attr;
25982 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25983 if (likely(name_attr)) {
25984 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25988 if (unlikely(ret < 0)) {
25992 Py_XDECREF(name_attr);
25995 static int __Pyx_setup_reduce(PyObject* type_obj) {
25997 PyObject *object_reduce = NULL;
25998 PyObject *object_getstate = NULL;
25999 PyObject *object_reduce_ex = NULL;
26000 PyObject *reduce = NULL;
26001 PyObject *reduce_ex = NULL;
26002 PyObject *reduce_cython = NULL;
26003 PyObject *setstate = NULL;
26004 PyObject *setstate_cython = NULL;
26005 PyObject *getstate = NULL;
26006 #if CYTHON_USE_PYTYPE_LOOKUP
26007 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26009 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26010 if (!getstate && PyErr_Occurred()) {
26015 #if CYTHON_USE_PYTYPE_LOOKUP
26016 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26018 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26019 if (!object_getstate && PyErr_Occurred()) {
26023 if (object_getstate != getstate) {
26027 #if CYTHON_USE_PYTYPE_LOOKUP
26028 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26030 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26032 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
26033 if (reduce_ex == object_reduce_ex) {
26034 #if CYTHON_USE_PYTYPE_LOOKUP
26035 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26037 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26039 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
26040 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26041 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26042 if (likely(reduce_cython)) {
26043 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26044 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26045 }
else if (reduce == object_reduce || PyErr_Occurred()) {
26048 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26049 if (!setstate) PyErr_Clear();
26050 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26051 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26052 if (likely(setstate_cython)) {
26053 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26054 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26055 }
else if (!setstate || PyErr_Occurred()) {
26059 PyType_Modified((PyTypeObject*)type_obj);
26064 if (!PyErr_Occurred())
26065 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26068 #if !CYTHON_USE_PYTYPE_LOOKUP
26069 Py_XDECREF(object_reduce);
26070 Py_XDECREF(object_reduce_ex);
26071 Py_XDECREF(object_getstate);
26072 Py_XDECREF(getstate);
26074 Py_XDECREF(reduce);
26075 Py_XDECREF(reduce_ex);
26076 Py_XDECREF(reduce_cython);
26077 Py_XDECREF(setstate);
26078 Py_XDECREF(setstate_cython);
26083 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26084 PyObject* fake_module;
26085 PyTypeObject* cached_type = NULL;
26086 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
26087 if (!fake_module)
return NULL;
26088 Py_INCREF(fake_module);
26089 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26091 if (!PyType_Check((PyObject*)cached_type)) {
26092 PyErr_Format(PyExc_TypeError,
26093 "Shared Cython type %.200s is not a type object",
26097 if (cached_type->tp_basicsize != type->tp_basicsize) {
26098 PyErr_Format(PyExc_TypeError,
26099 "Shared Cython type %.200s has the wrong size, try recompiling",
26104 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
26106 if (PyType_Ready(type) < 0)
goto bad;
26107 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26110 cached_type = type;
26113 Py_DECREF(fake_module);
26114 return cached_type;
26116 Py_XDECREF(cached_type);
26117 cached_type = NULL;
26122 #include <structmember.h>
26124 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
26126 if (unlikely(op->func_doc == NULL)) {
26127 if (op->func.m_ml->ml_doc) {
26128 #if PY_MAJOR_VERSION >= 3
26129 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26131 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26133 if (unlikely(op->func_doc == NULL))
26136 Py_INCREF(Py_None);
26140 Py_INCREF(op->func_doc);
26141 return op->func_doc;
26144 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26146 PyObject *tmp = op->func_doc;
26147 if (value == NULL) {
26151 op->func_doc = value;
26156 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26158 if (unlikely(op->func_name == NULL)) {
26159 #if PY_MAJOR_VERSION >= 3
26160 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26162 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26164 if (unlikely(op->func_name == NULL))
26167 Py_INCREF(op->func_name);
26168 return op->func_name;
26171 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26174 #if PY_MAJOR_VERSION >= 3
26175 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26177 if (unlikely(value == NULL || !PyString_Check(value)))
26180 PyErr_SetString(PyExc_TypeError,
26181 "__name__ must be set to a string object");
26184 tmp = op->func_name;
26186 op->func_name = value;
26191 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26193 Py_INCREF(op->func_qualname);
26194 return op->func_qualname;
26197 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26200 #if PY_MAJOR_VERSION >= 3
26201 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26203 if (unlikely(value == NULL || !PyString_Check(value)))
26206 PyErr_SetString(PyExc_TypeError,
26207 "__qualname__ must be set to a string object");
26210 tmp = op->func_qualname;
26212 op->func_qualname = value;
26217 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
26220 self = m->func_closure;
26227 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26229 if (unlikely(op->func_dict == NULL)) {
26230 op->func_dict = PyDict_New();
26231 if (unlikely(op->func_dict == NULL))
26234 Py_INCREF(op->func_dict);
26235 return op->func_dict;
26238 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26241 if (unlikely(value == NULL)) {
26242 PyErr_SetString(PyExc_TypeError,
26243 "function's dictionary may not be deleted");
26246 if (unlikely(!PyDict_Check(value))) {
26247 PyErr_SetString(PyExc_TypeError,
26248 "setting function's dictionary to a non-dict");
26251 tmp = op->func_dict;
26253 op->func_dict = value;
26258 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26260 Py_INCREF(op->func_globals);
26261 return op->func_globals;
26264 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26266 Py_INCREF(Py_None);
26270 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26272 PyObject* result = (op->func_code) ? op->func_code : Py_None;
26277 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26279 PyObject *res = op->defaults_getter((PyObject *) op);
26280 if (unlikely(!res))
26282 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26283 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26284 Py_INCREF(op->defaults_tuple);
26285 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26286 Py_INCREF(op->defaults_kwdict);
26288 op->defaults_tuple = PySequence_ITEM(res, 0);
26289 if (unlikely(!op->defaults_tuple)) result = -1;
26291 op->defaults_kwdict = PySequence_ITEM(res, 1);
26292 if (unlikely(!op->defaults_kwdict)) result = -1;
26299 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26303 }
else if (value != Py_None && !PyTuple_Check(value)) {
26304 PyErr_SetString(PyExc_TypeError,
26305 "__defaults__ must be set to a tuple object");
26309 tmp = op->defaults_tuple;
26310 op->defaults_tuple = value;
26315 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26316 PyObject* result = op->defaults_tuple;
26317 if (unlikely(!result)) {
26318 if (op->defaults_getter) {
26319 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26320 result = op->defaults_tuple;
26329 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26333 }
else if (value != Py_None && !PyDict_Check(value)) {
26334 PyErr_SetString(PyExc_TypeError,
26335 "__kwdefaults__ must be set to a dict object");
26339 tmp = op->defaults_kwdict;
26340 op->defaults_kwdict = value;
26345 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26346 PyObject* result = op->defaults_kwdict;
26347 if (unlikely(!result)) {
26348 if (op->defaults_getter) {
26349 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26350 result = op->defaults_kwdict;
26359 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26361 if (!value || value == Py_None) {
26363 }
else if (!PyDict_Check(value)) {
26364 PyErr_SetString(PyExc_TypeError,
26365 "__annotations__ must be set to a dict object");
26369 tmp = op->func_annotations;
26370 op->func_annotations = value;
26375 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26376 PyObject* result = op->func_annotations;
26377 if (unlikely(!result)) {
26378 result = PyDict_New();
26379 if (unlikely(!result))
return NULL;
26380 op->func_annotations = result;
26385 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26386 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26387 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26388 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26389 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26390 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26391 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26392 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26393 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26394 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26395 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26396 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26397 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26398 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26399 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26400 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26401 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26402 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26403 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26406 static PyMemberDef __pyx_CyFunction_members[] = {
26407 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26411 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26413 #if PY_MAJOR_VERSION >= 3
26414 Py_INCREF(m->func_qualname);
26415 return m->func_qualname;
26417 return PyString_FromString(m->func.m_ml->ml_name);
26420 static PyMethodDef __pyx_CyFunction_methods[] = {
26421 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26424 #if PY_VERSION_HEX < 0x030500A0
26425 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26427 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26429 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
26430 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26431 if (unlikely(op == NULL))
26434 __Pyx_CyFunction_weakreflist(op) = NULL;
26435 op->func.m_ml = ml;
26436 op->func.m_self = (PyObject *) op;
26437 Py_XINCREF(closure);
26438 op->func_closure = closure;
26439 Py_XINCREF(module);
26440 op->func.m_module = module;
26441 op->func_dict = NULL;
26442 op->func_name = NULL;
26443 Py_INCREF(qualname);
26444 op->func_qualname = qualname;
26445 op->func_doc = NULL;
26446 op->func_classobj = NULL;
26447 op->func_globals = globals;
26448 Py_INCREF(op->func_globals);
26450 op->func_code = code;
26451 op->defaults_pyobjects = 0;
26452 op->defaults_size = 0;
26453 op->defaults = NULL;
26454 op->defaults_tuple = NULL;
26455 op->defaults_kwdict = NULL;
26456 op->defaults_getter = NULL;
26457 op->func_annotations = NULL;
26458 return (PyObject *) op;
26461 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26463 Py_CLEAR(m->func_closure);
26464 Py_CLEAR(m->func.m_module);
26465 Py_CLEAR(m->func_dict);
26466 Py_CLEAR(m->func_name);
26467 Py_CLEAR(m->func_qualname);
26468 Py_CLEAR(m->func_doc);
26469 Py_CLEAR(m->func_globals);
26470 Py_CLEAR(m->func_code);
26471 Py_CLEAR(m->func_classobj);
26472 Py_CLEAR(m->defaults_tuple);
26473 Py_CLEAR(m->defaults_kwdict);
26474 Py_CLEAR(m->func_annotations);
26476 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26478 for (i = 0; i < m->defaults_pyobjects; i++)
26479 Py_XDECREF(pydefaults[i]);
26480 PyObject_Free(m->defaults);
26481 m->defaults = NULL;
26485 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26487 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26488 PyObject_ClearWeakRefs((PyObject *) m);
26489 __Pyx_CyFunction_clear(m);
26490 PyObject_GC_Del(m);
26492 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26494 PyObject_GC_UnTrack(m);
26495 __Pyx__CyFunction_dealloc(m);
26497 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26499 Py_VISIT(m->func_closure);
26500 Py_VISIT(m->func.m_module);
26501 Py_VISIT(m->func_dict);
26502 Py_VISIT(m->func_name);
26503 Py_VISIT(m->func_qualname);
26504 Py_VISIT(m->func_doc);
26505 Py_VISIT(m->func_globals);
26506 Py_VISIT(m->func_code);
26507 Py_VISIT(m->func_classobj);
26508 Py_VISIT(m->defaults_tuple);
26509 Py_VISIT(m->defaults_kwdict);
26511 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26513 for (i = 0; i < m->defaults_pyobjects; i++)
26514 Py_VISIT(pydefaults[i]);
26518 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26520 #if PY_MAJOR_VERSION < 3
26521 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26522 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26526 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26528 type = (PyObject *)(Py_TYPE(obj));
26529 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26531 if (obj == Py_None)
26534 return __Pyx_PyMethod_New(func, obj, type);
26537 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26539 #if PY_MAJOR_VERSION >= 3
26540 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26541 op->func_qualname, (
void *)op);
26543 return PyString_FromFormat(
"<cyfunction %s at %p>",
26544 PyString_AsString(op->func_qualname), (
void *)op);
26547 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26548 PyCFunctionObject* f = (PyCFunctionObject*)func;
26549 PyCFunction meth = f->m_ml->ml_meth;
26551 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26553 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26554 return (*meth)(
self, arg);
26556 case METH_VARARGS | METH_KEYWORDS:
26557 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26559 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26560 size = PyTuple_GET_SIZE(arg);
26561 if (likely(size == 0))
26562 return (*meth)(
self, NULL);
26563 PyErr_Format(PyExc_TypeError,
26564 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26565 f->m_ml->ml_name, size);
26570 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26571 size = PyTuple_GET_SIZE(arg);
26572 if (likely(size == 1)) {
26573 PyObject *result, *arg0;
26574 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26575 arg0 = PyTuple_GET_ITEM(arg, 0);
26577 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26579 result = (*meth)(
self, arg0);
26580 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26585 PyErr_Format(PyExc_TypeError,
26586 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26587 f->m_ml->ml_name, size);
26592 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26593 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26594 "longer supported!");
26597 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26601 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26602 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26604 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26606 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26607 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26609 PyObject *new_args;
26611 argc = PyTuple_GET_SIZE(args);
26612 new_args = PyTuple_GetSlice(args, 1, argc);
26613 if (unlikely(!new_args))
26615 self = PyTuple_GetItem(args, 0);
26616 if (unlikely(!
self)) {
26617 Py_DECREF(new_args);
26618 #if PY_MAJOR_VERSION > 2
26619 PyErr_Format(PyExc_TypeError,
26620 "unbound method %.200S() needs an argument",
26621 cyfunc->func_qualname);
26623 PyErr_SetString(PyExc_TypeError,
26624 "unbound method needs an argument");
26628 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26629 Py_DECREF(new_args);
26631 result = __Pyx_CyFunction_Call(func, args, kw);
26635 static PyTypeObject __pyx_CyFunctionType_type = {
26636 PyVarObject_HEAD_INIT(0, 0)
26637 "cython_function_or_method",
26638 sizeof(__pyx_CyFunctionObject),
26640 (destructor) __Pyx_CyFunction_dealloc,
26644 #if PY_MAJOR_VERSION < 3
26649 (reprfunc) __Pyx_CyFunction_repr,
26654 __Pyx_CyFunction_CallAsMethod,
26659 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26661 (traverseproc) __Pyx_CyFunction_traverse,
26662 (inquiry) __Pyx_CyFunction_clear,
26664 #
if PY_VERSION_HEX < 0x030500A0
26665 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26667 offsetof(PyCFunctionObject, m_weakreflist),
26671 __pyx_CyFunction_methods,
26672 __pyx_CyFunction_members,
26673 __pyx_CyFunction_getsets,
26676 __Pyx_CyFunction_descr_get,
26678 offsetof(__pyx_CyFunctionObject, func_dict),
26691 #if PY_VERSION_HEX >= 0x030400a1
26694 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26697 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26700 #if PY_VERSION_HEX >= 0x030C0000
26703 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26707 static int __pyx_CyFunction_init(
void) {
26708 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26709 if (unlikely(__pyx_CyFunctionType == NULL)) {
26714 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26715 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26716 m->defaults = PyObject_Malloc(size);
26717 if (unlikely(!m->defaults))
26718 return PyErr_NoMemory();
26719 memset(m->defaults, 0, size);
26720 m->defaults_pyobjects = pyobjects;
26721 m->defaults_size = size;
26722 return m->defaults;
26724 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26725 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26726 m->defaults_tuple = tuple;
26729 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26730 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26731 m->defaults_kwdict = dict;
26734 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26735 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26736 m->func_annotations = dict;
26741 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26742 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26743 PyObject *op = __Pyx_CyFunction_Init(
26744 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26745 ml, flags, qualname, closure, module, globals, code
26748 PyObject_GC_Track(op);
26754 #ifndef CYTHON_CLINE_IN_TRACEBACK
26755 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
26756 PyObject *use_cline;
26757 PyObject *ptype, *pvalue, *ptraceback;
26758 #if CYTHON_COMPILING_IN_CPYTHON
26759 PyObject **cython_runtime_dict;
26761 if (unlikely(!__pyx_cython_runtime)) {
26764 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26765 #if CYTHON_COMPILING_IN_CPYTHON
26766 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26767 if (likely(cython_runtime_dict)) {
26768 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26769 use_cline, *cython_runtime_dict,
26770 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26774 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26775 if (use_cline_obj) {
26776 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26777 Py_DECREF(use_cline_obj);
26785 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26787 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26790 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26796 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26797 int start = 0, mid = 0, end = count - 1;
26798 if (end >= 0 && code_line > entries[end].code_line) {
26801 while (start < end) {
26802 mid = start + (end - start) / 2;
26803 if (code_line < entries[mid].code_line) {
26805 }
else if (code_line > entries[mid].code_line) {
26811 if (code_line <= entries[mid].code_line) {
26817 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26818 PyCodeObject* code_object;
26820 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26823 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26824 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26827 code_object = __pyx_code_cache.entries[pos].code_object;
26828 Py_INCREF(code_object);
26829 return code_object;
26831 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26833 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26834 if (unlikely(!code_line)) {
26837 if (unlikely(!entries)) {
26838 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26839 if (likely(entries)) {
26840 __pyx_code_cache.entries = entries;
26841 __pyx_code_cache.max_count = 64;
26842 __pyx_code_cache.count = 1;
26843 entries[0].code_line = code_line;
26844 entries[0].code_object = code_object;
26845 Py_INCREF(code_object);
26849 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26850 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26851 PyCodeObject* tmp = entries[pos].code_object;
26852 entries[pos].code_object = code_object;
26856 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26857 int new_max = __pyx_code_cache.max_count + 64;
26858 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26859 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26860 if (unlikely(!entries)) {
26863 __pyx_code_cache.entries = entries;
26864 __pyx_code_cache.max_count = new_max;
26866 for (i=__pyx_code_cache.count; i>pos; i--) {
26867 entries[i] = entries[i-1];
26869 entries[pos].code_line = code_line;
26870 entries[pos].code_object = code_object;
26871 __pyx_code_cache.count++;
26872 Py_INCREF(code_object);
26876 #include "compile.h"
26877 #include "frameobject.h"
26878 #include "traceback.h"
26879 #if PY_VERSION_HEX >= 0x030b00a6
26880 #ifndef Py_BUILD_CORE
26881 #define Py_BUILD_CORE 1
26883 #include "internal/pycore_frame.h"
26885 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26886 const char *funcname,
int c_line,
26887 int py_line,
const char *filename) {
26888 PyCodeObject *py_code = NULL;
26889 PyObject *py_funcname = NULL;
26890 #if PY_MAJOR_VERSION < 3
26891 PyObject *py_srcfile = NULL;
26892 py_srcfile = PyString_FromString(filename);
26893 if (!py_srcfile)
goto bad;
26896 #if PY_MAJOR_VERSION < 3
26897 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26898 if (!py_funcname)
goto bad;
26900 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26901 if (!py_funcname)
goto bad;
26902 funcname = PyUnicode_AsUTF8(py_funcname);
26903 if (!funcname)
goto bad;
26907 #if PY_MAJOR_VERSION < 3
26908 py_funcname = PyString_FromString(funcname);
26909 if (!py_funcname)
goto bad;
26912 #if PY_MAJOR_VERSION < 3
26913 py_code = __Pyx_PyCode_New(
26930 Py_DECREF(py_srcfile);
26932 py_code = PyCode_NewEmpty(filename, funcname, py_line);
26934 Py_XDECREF(py_funcname);
26937 Py_XDECREF(py_funcname);
26938 #if PY_MAJOR_VERSION < 3
26939 Py_XDECREF(py_srcfile);
26943 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26944 int py_line,
const char *filename) {
26945 PyCodeObject *py_code = 0;
26946 PyFrameObject *py_frame = 0;
26947 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26948 PyObject *ptype, *pvalue, *ptraceback;
26950 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26952 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26954 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26955 py_code = __Pyx_CreateCodeObjectForTraceback(
26956 funcname, c_line, py_line, filename);
26961 Py_XDECREF(pvalue);
26962 Py_XDECREF(ptraceback);
26965 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26966 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26968 py_frame = PyFrame_New(
26974 if (!py_frame)
goto bad;
26975 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26976 PyTraceBack_Here(py_frame);
26978 Py_XDECREF(py_code);
26979 Py_XDECREF(py_frame);
26982 #if PY_MAJOR_VERSION < 3
26983 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26984 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26985 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26986 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26987 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26990 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26991 PyObject *obj = view->obj;
26993 if (PyObject_CheckBuffer(obj)) {
26994 PyBuffer_Release(view);
27006 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27008 int i, index, step, start;
27009 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27010 if (order ==
'F') {
27017 for (i = 0; i < ndim; i++) {
27018 index = start + step * i;
27019 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27021 itemsize *= mvs.shape[index];
27028 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27029 void **out_start,
void **out_end,
27030 int ndim,
size_t itemsize)
27034 start = end = slice->data;
27035 for (i = 0; i < ndim; i++) {
27036 Py_ssize_t stride = slice->strides[i];
27037 Py_ssize_t extent = slice->shape[i];
27039 *out_start = *out_end = start;
27043 end += stride * (extent - 1);
27045 start += stride * (extent - 1);
27048 *out_start = start;
27049 *out_end = end + itemsize;
27052 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27053 __Pyx_memviewslice *slice2,
27054 int ndim,
size_t itemsize)
27056 void *start1, *end1, *start2, *end2;
27057 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27058 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27059 return (start1 < end2) && (start2 < end1);
27063 static CYTHON_INLINE PyObject *
27064 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27067 #if PY_VERSION_HEX >= 0x02070000
27068 cobj = PyCapsule_New(p, sig, NULL);
27070 cobj = PyCObject_FromVoidPtr(p, NULL);
27076 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27077 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27078 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27079 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27080 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27082 func_type value = func_value;\
27083 if (sizeof(target_type) < sizeof(func_type)) {\
27084 if (unlikely(value != (func_type) (target_type) value)) {\
27085 func_type zero = 0;\
27086 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27087 return (target_type) -1;\
27088 if (is_unsigned && unlikely(value < zero))\
27089 goto raise_neg_overflow;\
27091 goto raise_overflow;\
27094 return (target_type) value;\
27098 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27104 S.u32 = 0x01020304;
27105 return S.u8[0] == 4;
27109 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27110 __Pyx_BufFmt_StackElem* stack,
27111 __Pyx_TypeInfo* type) {
27112 stack[0].field = &ctx->root;
27113 stack[0].parent_offset = 0;
27114 ctx->root.type = type;
27115 ctx->root.name =
"buffer dtype";
27116 ctx->root.offset = 0;
27118 ctx->head->field = &ctx->root;
27119 ctx->fmt_offset = 0;
27120 ctx->head->parent_offset = 0;
27121 ctx->new_packmode =
'@';
27122 ctx->enc_packmode =
'@';
27123 ctx->new_count = 1;
27124 ctx->enc_count = 0;
27126 ctx->is_complex = 0;
27127 ctx->is_valid_array = 0;
27128 ctx->struct_alignment = 0;
27129 while (type->typegroup ==
'S') {
27131 ctx->head->field = type->fields;
27132 ctx->head->parent_offset = 0;
27133 type = type->fields->type;
27136 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27138 const char* t = *ts;
27139 if (*t < '0' || *t >
'9') {
27142 count = *t++ -
'0';
27143 while (*t >=
'0' && *t <=
'9') {
27145 count += *t++ -
'0';
27151 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27152 int number = __Pyx_BufFmt_ParseNumber(ts);
27154 PyErr_Format(PyExc_ValueError,\
27155 "Does not understand character buffer dtype format string ('%c')", **ts);
27158 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27159 PyErr_Format(PyExc_ValueError,
27160 "Unexpected format string character: '%c'", ch);
27162 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27164 case '?':
return "'bool'";
27165 case 'c':
return "'char'";
27166 case 'b':
return "'signed char'";
27167 case 'B':
return "'unsigned char'";
27168 case 'h':
return "'short'";
27169 case 'H':
return "'unsigned short'";
27170 case 'i':
return "'int'";
27171 case 'I':
return "'unsigned int'";
27172 case 'l':
return "'long'";
27173 case 'L':
return "'unsigned long'";
27174 case 'q':
return "'long long'";
27175 case 'Q':
return "'unsigned long long'";
27176 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27177 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27178 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27179 case 'T':
return "a struct";
27180 case 'O':
return "Python object";
27181 case 'P':
return "a pointer";
27182 case 's':
case 'p':
return "a string";
27183 case 0:
return "end";
27184 default:
return "unparseable format string";
27187 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
27189 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27190 case 'h':
case 'H':
return 2;
27191 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
27192 case 'q':
case 'Q':
return 8;
27193 case 'f':
return (is_complex ? 8 : 4);
27194 case 'd':
return (is_complex ? 16 : 8);
27196 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
27199 case 'O':
case 'P':
return sizeof(
void*);
27201 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27205 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
27207 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27208 case 'h':
case 'H':
return sizeof(short);
27209 case 'i':
case 'I':
return sizeof(int);
27210 case 'l':
case 'L':
return sizeof(long);
27211 #ifdef HAVE_LONG_LONG
27212 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
27214 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
27215 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
27216 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
27217 case 'O':
case 'P':
return sizeof(
void*);
27219 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27224 typedef struct {
char c;
short x; } __Pyx_st_short;
27225 typedef struct {
char c;
int x; } __Pyx_st_int;
27226 typedef struct {
char c;
long x; } __Pyx_st_long;
27227 typedef struct {
char c;
float x; } __Pyx_st_float;
27228 typedef struct {
char c;
double x; } __Pyx_st_double;
27229 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
27230 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
27231 #ifdef HAVE_LONG_LONG
27232 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27234 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
27236 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27237 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
27238 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
27239 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
27240 #ifdef HAVE_LONG_LONG
27241 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
27243 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
27244 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
27245 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
27246 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
27248 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27256 typedef struct {
short x;
char c; } __Pyx_pad_short;
27257 typedef struct {
int x;
char c; } __Pyx_pad_int;
27258 typedef struct {
long x;
char c; } __Pyx_pad_long;
27259 typedef struct {
float x;
char c; } __Pyx_pad_float;
27260 typedef struct {
double x;
char c; } __Pyx_pad_double;
27261 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
27262 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
27263 #ifdef HAVE_LONG_LONG
27264 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
27266 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
27268 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27269 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
27270 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
27271 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
27272 #ifdef HAVE_LONG_LONG
27273 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
27275 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
27276 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
27277 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
27278 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
27280 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27284 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
27288 case 'b':
case 'h':
case 'i':
27289 case 'l':
case 'q':
case 's':
case 'p':
27291 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
27293 case 'f':
case 'd':
case 'g':
27294 return (is_complex ?
'C' :
'R');
27300 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27305 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27306 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27307 const char* expected;
27309 if (ctx->head == NULL) {
27313 expected = ctx->head->field->type->name;
27316 PyErr_Format(PyExc_ValueError,
27317 "Buffer dtype mismatch, expected %s%s%s but got %s",
27318 quote, expected, quote,
27319 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27321 __Pyx_StructField* field = ctx->head->field;
27322 __Pyx_StructField* parent = (ctx->head - 1)->field;
27323 PyErr_Format(PyExc_ValueError,
27324 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27325 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27326 parent->type->name, field->name);
27329 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27331 size_t size, offset, arraysize = 1;
27332 if (ctx->enc_type == 0)
return 0;
27333 if (ctx->head->field->type->arraysize[0]) {
27335 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27336 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27338 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27339 PyErr_Format(PyExc_ValueError,
27340 "Expected a dimension of size %zu, got %zu",
27341 ctx->head->field->type->arraysize[0], ctx->enc_count);
27345 if (!ctx->is_valid_array) {
27346 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27347 ctx->head->field->type->ndim, ndim);
27350 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27351 arraysize *= ctx->head->field->type->arraysize[i];
27353 ctx->is_valid_array = 0;
27354 ctx->enc_count = 1;
27356 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27358 __Pyx_StructField* field = ctx->head->field;
27359 __Pyx_TypeInfo* type = field->type;
27360 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27361 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27363 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27365 if (ctx->enc_packmode ==
'@') {
27366 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27367 size_t align_mod_offset;
27368 if (align_at == 0)
return -1;
27369 align_mod_offset = ctx->fmt_offset % align_at;
27370 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27371 if (ctx->struct_alignment == 0)
27372 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27375 if (type->size != size || type->typegroup != group) {
27376 if (type->typegroup ==
'C' && type->fields != NULL) {
27377 size_t parent_offset = ctx->head->parent_offset + field->offset;
27379 ctx->head->field = type->fields;
27380 ctx->head->parent_offset = parent_offset;
27383 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27385 __Pyx_BufFmt_RaiseExpected(ctx);
27389 offset = ctx->head->parent_offset + field->offset;
27390 if (ctx->fmt_offset != offset) {
27391 PyErr_Format(PyExc_ValueError,
27392 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27393 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27396 ctx->fmt_offset += size;
27398 ctx->fmt_offset += (arraysize - 1) * size;
27401 if (field == &ctx->root) {
27403 if (ctx->enc_count != 0) {
27404 __Pyx_BufFmt_RaiseExpected(ctx);
27409 ctx->head->field = ++field;
27410 if (field->type == NULL) {
27412 field = ctx->head->field;
27414 }
else if (field->type->typegroup ==
'S') {
27415 size_t parent_offset = ctx->head->parent_offset + field->offset;
27416 if (field->type->fields->type == NULL)
continue;
27417 field = field->type->fields;
27419 ctx->head->field = field;
27420 ctx->head->parent_offset = parent_offset;
27426 }
while (ctx->enc_count);
27428 ctx->is_complex = 0;
27432 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27434 const char *ts = *tsp;
27435 int i = 0, number, ndim;
27437 if (ctx->new_count != 1) {
27438 PyErr_SetString(PyExc_ValueError,
27439 "Cannot handle repeated arrays in format string");
27442 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27443 ndim = ctx->head->field->type->ndim;
27444 while (*ts && *ts !=
')') {
27446 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27449 number = __Pyx_BufFmt_ExpectNumber(&ts);
27450 if (number == -1)
return NULL;
27451 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
27452 return PyErr_Format(PyExc_ValueError,
27453 "Expected a dimension of size %zu, got %d",
27454 ctx->head->field->type->arraysize[i], number);
27455 if (*ts !=
',' && *ts !=
')')
27456 return PyErr_Format(PyExc_ValueError,
27457 "Expected a comma in format string, got '%c'", *ts);
27458 if (*ts ==
',') ts++;
27462 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27463 ctx->head->field->type->ndim, i);
27465 PyErr_SetString(PyExc_ValueError,
27466 "Unexpected end of format string, expected ')'");
27469 ctx->is_valid_array = 1;
27470 ctx->new_count = 1;
27474 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27479 if (ctx->enc_type != 0 && ctx->head == NULL) {
27480 __Pyx_BufFmt_RaiseExpected(ctx);
27483 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27484 if (ctx->head != NULL) {
27485 __Pyx_BufFmt_RaiseExpected(ctx);
27495 if (!__Pyx_Is_Little_Endian()) {
27496 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27499 ctx->new_packmode =
'=';
27504 if (__Pyx_Is_Little_Endian()) {
27505 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27508 ctx->new_packmode =
'=';
27514 ctx->new_packmode = *ts++;
27518 const char* ts_after_sub;
27519 size_t i, struct_count = ctx->new_count;
27520 size_t struct_alignment = ctx->struct_alignment;
27521 ctx->new_count = 1;
27524 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27527 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27529 ctx->enc_count = 0;
27530 ctx->struct_alignment = 0;
27533 for (i = 0; i != struct_count; ++i) {
27534 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27535 if (!ts_after_sub)
return NULL;
27538 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27543 size_t alignment = ctx->struct_alignment;
27545 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27547 if (alignment && ctx->fmt_offset % alignment) {
27548 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27553 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27554 ctx->fmt_offset += ctx->new_count;
27555 ctx->new_count = 1;
27556 ctx->enc_count = 0;
27558 ctx->enc_packmode = ctx->new_packmode;
27564 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27565 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27568 CYTHON_FALLTHROUGH;
27569 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27570 case 'l':
case 'L':
case 'q':
case 'Q':
27571 case 'f':
case 'd':
case 'g':
27572 case 'O':
case 'p':
27573 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27574 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27575 ctx->enc_count += ctx->new_count;
27576 ctx->new_count = 1;
27581 CYTHON_FALLTHROUGH;
27583 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27584 ctx->enc_count = ctx->new_count;
27585 ctx->enc_packmode = ctx->new_packmode;
27586 ctx->enc_type = *ts;
27587 ctx->is_complex = got_Z;
27589 ctx->new_count = 1;
27594 while(*ts !=
':') ++ts;
27598 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27602 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27603 if (number == -1)
return NULL;
27604 ctx->new_count = (size_t)number;
27612 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27619 if (a->size != b->size || a->typegroup != b->typegroup ||
27620 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27621 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27622 return a->size == b->size;
27628 for (i = 0; i < a->ndim; i++)
27629 if (a->arraysize[i] != b->arraysize[i])
27632 if (a->typegroup ==
'S') {
27633 if (a->flags != b->flags)
27635 if (a->fields || b->fields) {
27636 if (!(a->fields && b->fields))
27638 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27639 __Pyx_StructField *field_a = a->fields + i;
27640 __Pyx_StructField *field_b = b->fields + i;
27641 if (field_a->offset != field_b->offset ||
27642 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27645 return !a->fields[i].type && !b->fields[i].type;
27653 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27655 if (buf->shape[dim] <= 1)
27657 if (buf->strides) {
27658 if (spec & __Pyx_MEMVIEW_CONTIG) {
27659 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27660 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27661 PyErr_Format(PyExc_ValueError,
27662 "Buffer is not indirectly contiguous "
27663 "in dimension %d.", dim);
27666 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27667 PyErr_SetString(PyExc_ValueError,
27668 "Buffer and memoryview are not contiguous "
27669 "in the same dimension.");
27673 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27674 Py_ssize_t stride = buf->strides[dim];
27677 if (unlikely(stride < buf->itemsize)) {
27678 PyErr_SetString(PyExc_ValueError,
27679 "Buffer and memoryview are not contiguous "
27680 "in the same dimension.");
27685 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27686 PyErr_Format(PyExc_ValueError,
27687 "C-contiguous buffer is not contiguous in "
27688 "dimension %d", dim);
27690 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27691 PyErr_Format(PyExc_ValueError,
27692 "C-contiguous buffer is not indirect in "
27693 "dimension %d", dim);
27695 }
else if (unlikely(buf->suboffsets)) {
27696 PyErr_SetString(PyExc_ValueError,
27697 "Buffer exposes suboffsets but no strides");
27706 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27708 if (spec & __Pyx_MEMVIEW_DIRECT) {
27709 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27710 PyErr_Format(PyExc_ValueError,
27711 "Buffer not compatible with direct access "
27712 "in dimension %d.", dim);
27716 if (spec & __Pyx_MEMVIEW_PTR) {
27717 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27718 PyErr_Format(PyExc_ValueError,
27719 "Buffer is not indirectly accessible "
27720 "in dimension %d.", dim);
27729 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27732 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27733 Py_ssize_t stride = 1;
27734 for (i = 0; i < ndim; i++) {
27735 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27736 PyErr_SetString(PyExc_ValueError,
27737 "Buffer not fortran contiguous.");
27740 stride = stride * buf->shape[i];
27742 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27743 Py_ssize_t stride = 1;
27744 for (i = ndim - 1; i >- 1; i--) {
27745 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27746 PyErr_SetString(PyExc_ValueError,
27747 "Buffer not C contiguous.");
27750 stride = stride * buf->shape[i];
27757 static int __Pyx_ValidateAndInit_memviewslice(
27762 __Pyx_TypeInfo *dtype,
27763 __Pyx_BufFmt_StackElem stack[],
27764 __Pyx_memviewslice *memviewslice,
27765 PyObject *original_obj)
27767 struct __pyx_memoryview_obj *memview, *new_memview;
27768 __Pyx_RefNannyDeclarations
27770 int i, spec = 0, retval = -1;
27771 __Pyx_BufFmt_Context ctx;
27772 int from_memoryview = __pyx_memoryview_check(original_obj);
27773 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27774 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27775 original_obj)->typeinfo)) {
27776 memview = (
struct __pyx_memoryview_obj *) original_obj;
27777 new_memview = NULL;
27779 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27780 original_obj, buf_flags, 0, dtype);
27781 new_memview = memview;
27782 if (unlikely(!memview))
27785 buf = &memview->view;
27786 if (unlikely(buf->ndim != ndim)) {
27787 PyErr_Format(PyExc_ValueError,
27788 "Buffer has wrong number of dimensions (expected %d, got %d)",
27793 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27794 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
27796 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
27797 PyErr_Format(PyExc_ValueError,
27798 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27799 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27801 (buf->itemsize > 1) ?
"s" :
"",
27804 (dtype->size > 1) ?
"s" :
"");
27807 if (buf->len > 0) {
27808 for (i = 0; i < ndim; i++) {
27809 spec = axes_specs[i];
27810 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27812 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27815 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27818 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27819 new_memview != NULL) == -1)) {
27825 Py_XDECREF(new_memview);
27828 __Pyx_RefNannyFinishContext();
27833 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj,
int writable_flag) {
27834 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27835 __Pyx_BufFmt_StackElem stack[1];
27836 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27838 if (obj == Py_None) {
27839 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27842 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27843 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27844 &__Pyx_TypeInfo_float, stack,
27846 if (unlikely(retcode == -1))
27850 result.memview = NULL;
27851 result.data = NULL;
27856 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
27857 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27858 __Pyx_BufFmt_StackElem stack[1];
27859 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27861 if (obj == Py_None) {
27862 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27865 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27866 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27867 &__Pyx_TypeInfo_float, stack,
27869 if (unlikely(retcode == -1))
27873 result.memview = NULL;
27874 result.data = NULL;
27879 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj,
int writable_flag) {
27880 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27881 __Pyx_BufFmt_StackElem stack[1];
27882 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27884 if (obj == Py_None) {
27885 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27888 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27889 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27890 &__Pyx_TypeInfo_double, stack,
27892 if (unlikely(retcode == -1))
27896 result.memview = NULL;
27897 result.data = NULL;
27902 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
27903 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27904 __Pyx_BufFmt_StackElem stack[1];
27905 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27907 if (obj == Py_None) {
27908 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27911 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27912 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27913 &__Pyx_TypeInfo_double, stack,
27915 if (unlikely(retcode == -1))
27919 result.memview = NULL;
27920 result.data = NULL;
27925 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj,
int writable_flag) {
27926 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27927 __Pyx_BufFmt_StackElem stack[1];
27928 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27930 if (obj == Py_None) {
27931 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27934 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27935 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27936 &__Pyx_TypeInfo_long__double, stack,
27938 if (unlikely(retcode == -1))
27942 result.memview = NULL;
27943 result.data = NULL;
27948 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj,
int writable_flag) {
27949 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27950 __Pyx_BufFmt_StackElem stack[1];
27951 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27953 if (obj == Py_None) {
27954 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27957 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27958 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27959 &__Pyx_TypeInfo_long__double, stack,
27961 if (unlikely(retcode == -1))
27965 result.memview = NULL;
27966 result.data = NULL;
27971 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
27972 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27973 __Pyx_BufFmt_StackElem stack[1];
27974 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27976 if (obj == Py_None) {
27977 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27980 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27981 PyBUF_RECORDS_RO | writable_flag, 1,
27982 &__Pyx_TypeInfo_int, stack,
27984 if (unlikely(retcode == -1))
27988 result.memview = NULL;
27989 result.data = NULL;
27994 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
27995 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27996 __Pyx_BufFmt_StackElem stack[1];
27997 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27999 if (obj == Py_None) {
28000 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28003 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28004 PyBUF_RECORDS_RO | writable_flag, 1,
28005 &__Pyx_TypeInfo_float, stack,
28007 if (unlikely(retcode == -1))
28011 result.memview = NULL;
28012 result.data = NULL;
28017 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28018 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28019 __Pyx_BufFmt_StackElem stack[1];
28020 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28022 if (obj == Py_None) {
28023 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28026 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28027 PyBUF_RECORDS_RO | writable_flag, 1,
28028 &__Pyx_TypeInfo_double, stack,
28030 if (unlikely(retcode == -1))
28034 result.memview = NULL;
28035 result.data = NULL;
28040 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
28041 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28042 __Pyx_BufFmt_StackElem stack[1];
28043 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28045 if (obj == Py_None) {
28046 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28049 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28050 PyBUF_RECORDS_RO | writable_flag, 1,
28051 &__Pyx_TypeInfo_long__double, stack,
28053 if (unlikely(retcode == -1))
28057 result.memview = NULL;
28058 result.data = NULL;
28063 static __Pyx_memviewslice
28064 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28065 const char *mode,
int ndim,
28066 size_t sizeof_dtype,
int contig_flag,
28067 int dtype_is_object)
28069 __Pyx_RefNannyDeclarations
28071 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28072 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28073 Py_buffer *buf = &from_memview->view;
28074 PyObject *shape_tuple = NULL;
28075 PyObject *temp_int = NULL;
28076 struct __pyx_array_obj *array_obj = NULL;
28077 struct __pyx_memoryview_obj *memview_obj = NULL;
28078 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28079 for (i = 0; i < ndim; i++) {
28080 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28081 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
28082 "indirect dimensions (axis %d)", i);
28086 shape_tuple = PyTuple_New(ndim);
28087 if (unlikely(!shape_tuple)) {
28090 __Pyx_GOTREF(shape_tuple);
28091 for(i = 0; i < ndim; i++) {
28092 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28093 if(unlikely(!temp_int)) {
28096 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28100 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28101 if (unlikely(!array_obj)) {
28104 __Pyx_GOTREF(array_obj);
28105 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28106 (PyObject *) array_obj, contig_flag,
28108 from_mvs->memview->typeinfo);
28109 if (unlikely(!memview_obj))
28111 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28113 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28114 dtype_is_object) < 0))
28118 __Pyx_XDECREF(new_mvs.memview);
28119 new_mvs.memview = NULL;
28120 new_mvs.data = NULL;
28122 __Pyx_XDECREF(shape_tuple);
28123 __Pyx_XDECREF(temp_int);
28124 __Pyx_XDECREF(array_obj);
28125 __Pyx_RefNannyFinishContext();
28130 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28131 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28132 #pragma GCC diagnostic push
28133 #pragma GCC diagnostic ignored "-Wconversion"
28135 const long neg_one = (long) -1, const_zero = (
long) 0;
28136 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28137 #pragma GCC diagnostic pop
28139 const int is_unsigned = neg_one > const_zero;
28141 if (
sizeof(
long) <
sizeof(long)) {
28142 return PyInt_FromLong((
long) value);
28143 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28144 return PyLong_FromUnsignedLong((
unsigned long) value);
28145 #ifdef HAVE_LONG_LONG
28146 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28147 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28151 if (
sizeof(
long) <=
sizeof(
long)) {
28152 return PyInt_FromLong((
long) value);
28153 #ifdef HAVE_LONG_LONG
28154 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28155 return PyLong_FromLongLong((PY_LONG_LONG) value);
28160 int one = 1;
int little = (int)*(
unsigned char *)&one;
28161 unsigned char *bytes = (
unsigned char *)&value;
28162 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28163 little, !is_unsigned);
28168 static CYTHON_INLINE
LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *x) {
28169 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28170 #pragma GCC diagnostic push
28171 #pragma GCC diagnostic ignored "-Wconversion"
28174 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28175 #pragma GCC diagnostic pop
28177 const int is_unsigned = neg_one > const_zero;
28178 #if PY_MAJOR_VERSION < 3
28179 if (likely(PyInt_Check(x))) {
28181 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, PyInt_AS_LONG(x))
28183 long val = PyInt_AS_LONG(x);
28184 if (is_unsigned && unlikely(val < 0)) {
28185 goto raise_neg_overflow;
28191 if (likely(PyLong_Check(x))) {
28193 #if CYTHON_USE_PYLONG_INTERNALS
28194 const digit* digits = ((PyLongObject*)x)->ob_digit;
28195 switch (Py_SIZE(x)) {
28197 case 1: __PYX_VERIFY_RETURN_INT(
LongIndexType, digit, digits[0])
28200 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28201 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28202 }
else if (8 *
sizeof(
LongIndexType) >= 2 * PyLong_SHIFT) {
28209 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28210 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28211 }
else if (8 *
sizeof(
LongIndexType) >= 3 * PyLong_SHIFT) {
28218 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28219 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28220 }
else if (8 *
sizeof(
LongIndexType) >= 4 * PyLong_SHIFT) {
28227 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28228 if (unlikely(Py_SIZE(x) < 0)) {
28229 goto raise_neg_overflow;
28233 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28234 if (unlikely(result < 0))
28236 if (unlikely(result == 1))
28237 goto raise_neg_overflow;
28241 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
unsigned long, PyLong_AsUnsignedLong(x))
28242 #ifdef HAVE_LONG_LONG
28243 }
else if (
sizeof(
LongIndexType) <=
sizeof(
unsigned PY_LONG_LONG)) {
28244 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28248 #if CYTHON_USE_PYLONG_INTERNALS
28249 const digit* digits = ((PyLongObject*)x)->ob_digit;
28250 switch (Py_SIZE(x)) {
28252 case -1: __PYX_VERIFY_RETURN_INT(
LongIndexType, sdigit, (sdigit) (-(sdigit)digits[0]))
28253 case 1: __PYX_VERIFY_RETURN_INT(
LongIndexType, digit, +digits[0])
28256 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28257 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28258 }
else if (8 *
sizeof(
LongIndexType) - 1 > 2 * PyLong_SHIFT) {
28265 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28266 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28267 }
else if (8 *
sizeof(
LongIndexType) - 1 > 2 * PyLong_SHIFT) {
28274 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28275 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28276 }
else if (8 *
sizeof(
LongIndexType) - 1 > 3 * PyLong_SHIFT) {
28283 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28284 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28285 }
else if (8 *
sizeof(
LongIndexType) - 1 > 3 * PyLong_SHIFT) {
28292 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28293 __PYX_VERIFY_RETURN_INT(
LongIndexType,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28294 }
else if (8 *
sizeof(
LongIndexType) - 1 > 4 * PyLong_SHIFT) {
28301 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28302 __PYX_VERIFY_RETURN_INT(
LongIndexType,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28303 }
else if (8 *
sizeof(
LongIndexType) - 1 > 4 * PyLong_SHIFT) {
28311 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType,
long, PyLong_AsLong(x))
28312 #ifdef HAVE_LONG_LONG
28313 }
else if (
sizeof(
LongIndexType) <=
sizeof(PY_LONG_LONG)) {
28314 __PYX_VERIFY_RETURN_INT_EXC(
LongIndexType, PY_LONG_LONG, PyLong_AsLongLong(x))
28319 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28320 PyErr_SetString(PyExc_RuntimeError,
28321 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28324 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28325 #if PY_MAJOR_VERSION < 3
28326 if (likely(v) && !PyLong_Check(v)) {
28328 v = PyNumber_Long(tmp);
28333 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28334 unsigned char *bytes = (
unsigned char *)&val;
28335 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28336 bytes,
sizeof(val),
28337 is_little, !is_unsigned);
28347 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28349 val = __Pyx_PyInt_As_LongIndexType(tmp);
28354 PyErr_SetString(PyExc_OverflowError,
28355 "value too large to convert to LongIndexType");
28357 raise_neg_overflow:
28358 PyErr_SetString(PyExc_OverflowError,
28359 "can't convert negative value to LongIndexType");
28364 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28365 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28366 #pragma GCC diagnostic push
28367 #pragma GCC diagnostic ignored "-Wconversion"
28369 const int neg_one = (int) -1, const_zero = (
int) 0;
28370 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28371 #pragma GCC diagnostic pop
28373 const int is_unsigned = neg_one > const_zero;
28374 #if PY_MAJOR_VERSION < 3
28375 if (likely(PyInt_Check(x))) {
28376 if (
sizeof(
int) <
sizeof(long)) {
28377 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28379 long val = PyInt_AS_LONG(x);
28380 if (is_unsigned && unlikely(val < 0)) {
28381 goto raise_neg_overflow;
28387 if (likely(PyLong_Check(x))) {
28389 #if CYTHON_USE_PYLONG_INTERNALS
28390 const digit* digits = ((PyLongObject*)x)->ob_digit;
28391 switch (Py_SIZE(x)) {
28392 case 0:
return (
int) 0;
28393 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28395 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28396 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28397 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28398 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28399 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28404 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28405 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28406 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28407 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28408 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28413 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28414 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28415 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28416 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28417 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28423 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28424 if (unlikely(Py_SIZE(x) < 0)) {
28425 goto raise_neg_overflow;
28429 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28430 if (unlikely(result < 0))
28432 if (unlikely(result == 1))
28433 goto raise_neg_overflow;
28436 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28437 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28438 #ifdef HAVE_LONG_LONG
28439 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28440 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28444 #if CYTHON_USE_PYLONG_INTERNALS
28445 const digit* digits = ((PyLongObject*)x)->ob_digit;
28446 switch (Py_SIZE(x)) {
28447 case 0:
return (
int) 0;
28448 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28449 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28451 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28452 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28453 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28454 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28455 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28460 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28461 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28462 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28463 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28464 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28469 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28470 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28471 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28472 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28473 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28478 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28479 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28480 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28481 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28482 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28487 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28488 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28489 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28490 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28491 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28496 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28497 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28498 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28499 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28500 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28506 if (
sizeof(
int) <=
sizeof(long)) {
28507 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28508 #ifdef HAVE_LONG_LONG
28509 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28510 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28515 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28516 PyErr_SetString(PyExc_RuntimeError,
28517 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28520 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28521 #if PY_MAJOR_VERSION < 3
28522 if (likely(v) && !PyLong_Check(v)) {
28524 v = PyNumber_Long(tmp);
28529 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28530 unsigned char *bytes = (
unsigned char *)&val;
28531 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28532 bytes,
sizeof(val),
28533 is_little, !is_unsigned);
28543 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28544 if (!tmp)
return (
int) -1;
28545 val = __Pyx_PyInt_As_int(tmp);
28550 PyErr_SetString(PyExc_OverflowError,
28551 "value too large to convert to int");
28553 raise_neg_overflow:
28554 PyErr_SetString(PyExc_OverflowError,
28555 "can't convert negative value to int");
28560 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28561 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28562 #pragma GCC diagnostic push
28563 #pragma GCC diagnostic ignored "-Wconversion"
28565 const long neg_one = (long) -1, const_zero = (
long) 0;
28566 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28567 #pragma GCC diagnostic pop
28569 const int is_unsigned = neg_one > const_zero;
28570 #if PY_MAJOR_VERSION < 3
28571 if (likely(PyInt_Check(x))) {
28572 if (
sizeof(
long) <
sizeof(long)) {
28573 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28575 long val = PyInt_AS_LONG(x);
28576 if (is_unsigned && unlikely(val < 0)) {
28577 goto raise_neg_overflow;
28583 if (likely(PyLong_Check(x))) {
28585 #if CYTHON_USE_PYLONG_INTERNALS
28586 const digit* digits = ((PyLongObject*)x)->ob_digit;
28587 switch (Py_SIZE(x)) {
28588 case 0:
return (
long) 0;
28589 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28591 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28592 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28593 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28594 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28595 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28600 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28601 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28602 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28603 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28604 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28609 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28610 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28611 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28612 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28613 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28619 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28620 if (unlikely(Py_SIZE(x) < 0)) {
28621 goto raise_neg_overflow;
28625 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28626 if (unlikely(result < 0))
28628 if (unlikely(result == 1))
28629 goto raise_neg_overflow;
28632 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28633 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28634 #ifdef HAVE_LONG_LONG
28635 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28636 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28640 #if CYTHON_USE_PYLONG_INTERNALS
28641 const digit* digits = ((PyLongObject*)x)->ob_digit;
28642 switch (Py_SIZE(x)) {
28643 case 0:
return (
long) 0;
28644 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28645 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28647 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28648 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28649 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28650 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28651 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28656 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28657 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28658 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28659 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28660 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28665 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28666 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28667 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28668 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28669 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28674 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28675 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28676 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28677 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28678 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28683 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28684 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28685 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28686 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28687 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28692 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28693 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28694 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28695 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28696 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28702 if (
sizeof(
long) <=
sizeof(long)) {
28703 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28704 #ifdef HAVE_LONG_LONG
28705 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28706 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28711 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28712 PyErr_SetString(PyExc_RuntimeError,
28713 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28716 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28717 #if PY_MAJOR_VERSION < 3
28718 if (likely(v) && !PyLong_Check(v)) {
28720 v = PyNumber_Long(tmp);
28725 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28726 unsigned char *bytes = (
unsigned char *)&val;
28727 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28728 bytes,
sizeof(val),
28729 is_little, !is_unsigned);
28739 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28740 if (!tmp)
return (
long) -1;
28741 val = __Pyx_PyInt_As_long(tmp);
28746 PyErr_SetString(PyExc_OverflowError,
28747 "value too large to convert to long");
28749 raise_neg_overflow:
28750 PyErr_SetString(PyExc_OverflowError,
28751 "can't convert negative value to long");
28756 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28757 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28758 #pragma GCC diagnostic push
28759 #pragma GCC diagnostic ignored "-Wconversion"
28761 const int neg_one = (int) -1, const_zero = (
int) 0;
28762 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28763 #pragma GCC diagnostic pop
28765 const int is_unsigned = neg_one > const_zero;
28767 if (
sizeof(
int) <
sizeof(long)) {
28768 return PyInt_FromLong((
long) value);
28769 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28770 return PyLong_FromUnsignedLong((
unsigned long) value);
28771 #ifdef HAVE_LONG_LONG
28772 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28773 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28777 if (
sizeof(
int) <=
sizeof(
long)) {
28778 return PyInt_FromLong((
long) value);
28779 #ifdef HAVE_LONG_LONG
28780 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28781 return PyLong_FromLongLong((PY_LONG_LONG) value);
28786 int one = 1;
int little = (int)*(
unsigned char *)&one;
28787 unsigned char *bytes = (
unsigned char *)&value;
28788 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28789 little, !is_unsigned);
28794 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28795 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28796 #pragma GCC diagnostic push
28797 #pragma GCC diagnostic ignored "-Wconversion"
28799 const char neg_one = (char) -1, const_zero = (
char) 0;
28800 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28801 #pragma GCC diagnostic pop
28803 const int is_unsigned = neg_one > const_zero;
28804 #if PY_MAJOR_VERSION < 3
28805 if (likely(PyInt_Check(x))) {
28806 if (
sizeof(
char) <
sizeof(long)) {
28807 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28809 long val = PyInt_AS_LONG(x);
28810 if (is_unsigned && unlikely(val < 0)) {
28811 goto raise_neg_overflow;
28817 if (likely(PyLong_Check(x))) {
28819 #if CYTHON_USE_PYLONG_INTERNALS
28820 const digit* digits = ((PyLongObject*)x)->ob_digit;
28821 switch (Py_SIZE(x)) {
28822 case 0:
return (
char) 0;
28823 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28825 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28826 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28827 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28828 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28829 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28834 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28835 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28836 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28837 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28838 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28843 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28844 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28845 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28846 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28847 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28853 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28854 if (unlikely(Py_SIZE(x) < 0)) {
28855 goto raise_neg_overflow;
28859 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28860 if (unlikely(result < 0))
28862 if (unlikely(result == 1))
28863 goto raise_neg_overflow;
28866 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28867 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28868 #ifdef HAVE_LONG_LONG
28869 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28870 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28874 #if CYTHON_USE_PYLONG_INTERNALS
28875 const digit* digits = ((PyLongObject*)x)->ob_digit;
28876 switch (Py_SIZE(x)) {
28877 case 0:
return (
char) 0;
28878 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28879 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28881 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28882 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28883 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28884 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28885 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28890 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28891 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28892 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28893 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28894 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28899 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28900 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28901 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28902 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28903 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28908 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28909 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28910 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28911 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28912 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28917 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28918 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28919 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28920 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28921 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28926 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28927 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28928 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28929 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28930 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28936 if (
sizeof(
char) <=
sizeof(long)) {
28937 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28938 #ifdef HAVE_LONG_LONG
28939 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28940 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28945 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28946 PyErr_SetString(PyExc_RuntimeError,
28947 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28950 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28951 #if PY_MAJOR_VERSION < 3
28952 if (likely(v) && !PyLong_Check(v)) {
28954 v = PyNumber_Long(tmp);
28959 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28960 unsigned char *bytes = (
unsigned char *)&val;
28961 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28962 bytes,
sizeof(val),
28963 is_little, !is_unsigned);
28973 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28974 if (!tmp)
return (
char) -1;
28975 val = __Pyx_PyInt_As_char(tmp);
28980 PyErr_SetString(PyExc_OverflowError,
28981 "value too large to convert to char");
28983 raise_neg_overflow:
28984 PyErr_SetString(PyExc_OverflowError,
28985 "can't convert negative value to char");
28990 static int __Pyx_check_binary_version(
void) {
28992 int same=1, i, found_dot;
28993 const char* rt_from_call = Py_GetVersion();
28994 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28996 for (i = 0; i < 4; i++) {
28997 if (!ctversion[i]) {
28998 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
29001 if (rt_from_call[i] != ctversion[i]) {
29007 char rtversion[5] = {
'\0'};
29009 for (i=0; i<4; ++i) {
29010 if (rt_from_call[i] ==
'.') {
29011 if (found_dot)
break;
29013 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
29016 rtversion[i] = rt_from_call[i];
29018 PyOS_snprintf(message,
sizeof(message),
29019 "compiletime version %s of module '%.100s' "
29020 "does not match runtime version %s",
29021 ctversion, __Pyx_MODULE_NAME, rtversion);
29022 return PyErr_WarnEx(NULL, message, 1);
29028 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29030 #if PY_MAJOR_VERSION < 3
29031 if (t->is_unicode) {
29032 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29033 }
else if (t->intern) {
29034 *t->p = PyString_InternFromString(t->s);
29036 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29039 if (t->is_unicode | t->is_str) {
29041 *t->p = PyUnicode_InternFromString(t->s);
29042 }
else if (t->encoding) {
29043 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29045 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29048 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29053 if (PyObject_Hash(*t->p) == -1)
29060 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29061 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29063 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29065 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29067 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29068 #if !CYTHON_PEP393_ENABLED
29069 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29071 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29072 if (!defenc)
return NULL;
29073 defenc_c = PyBytes_AS_STRING(defenc);
29074 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29076 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29078 for (c = defenc_c; c < end; c++) {
29079 if ((
unsigned char) (*c) >= 128) {
29080 PyUnicode_AsASCIIString(o);
29086 *length = PyBytes_GET_SIZE(defenc);
29090 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29091 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29092 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29093 if (likely(PyUnicode_IS_ASCII(o))) {
29094 *length = PyUnicode_GET_LENGTH(o);
29095 return PyUnicode_AsUTF8(o);
29097 PyUnicode_AsASCIIString(o);
29101 return PyUnicode_AsUTF8AndSize(o, length);
29106 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29107 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29109 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29110 __Pyx_sys_getdefaultencoding_not_ascii &&
29112 PyUnicode_Check(o)) {
29113 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29116 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29117 if (PyByteArray_Check(o)) {
29118 *length = PyByteArray_GET_SIZE(o);
29119 return PyByteArray_AS_STRING(o);
29124 int r = PyBytes_AsStringAndSize(o, &result, length);
29125 if (unlikely(r < 0)) {
29132 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29133 int is_true = x == Py_True;
29134 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29135 else return PyObject_IsTrue(x);
29137 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29139 if (unlikely(!x))
return -1;
29140 retval = __Pyx_PyObject_IsTrue(x);
29144 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29145 #if PY_MAJOR_VERSION >= 3
29146 if (PyLong_Check(result)) {
29147 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29148 "__int__ returned non-int (type %.200s). "
29149 "The ability to return an instance of a strict subclass of int "
29150 "is deprecated, and may be removed in a future version of Python.",
29151 Py_TYPE(result)->tp_name)) {
29158 PyErr_Format(PyExc_TypeError,
29159 "__%.4s__ returned non-%.4s (type %.200s)",
29160 type_name, type_name, Py_TYPE(result)->tp_name);
29164 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29165 #if CYTHON_USE_TYPE_SLOTS
29166 PyNumberMethods *m;
29168 const char *name = NULL;
29169 PyObject *res = NULL;
29170 #if PY_MAJOR_VERSION < 3
29171 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29173 if (likely(PyLong_Check(x)))
29175 return __Pyx_NewRef(x);
29176 #if CYTHON_USE_TYPE_SLOTS
29177 m = Py_TYPE(x)->tp_as_number;
29178 #if PY_MAJOR_VERSION < 3
29179 if (m && m->nb_int) {
29181 res = m->nb_int(x);
29183 else if (m && m->nb_long) {
29185 res = m->nb_long(x);
29188 if (likely(m && m->nb_int)) {
29190 res = m->nb_int(x);
29194 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29195 res = PyNumber_Int(x);
29199 #if PY_MAJOR_VERSION < 3
29200 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29202 if (unlikely(!PyLong_CheckExact(res))) {
29204 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29207 else if (!PyErr_Occurred()) {
29208 PyErr_SetString(PyExc_TypeError,
29209 "an integer is required");
29213 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29216 #if PY_MAJOR_VERSION < 3
29217 if (likely(PyInt_CheckExact(b))) {
29218 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29219 return PyInt_AS_LONG(b);
29221 return PyInt_AsSsize_t(b);
29224 if (likely(PyLong_CheckExact(b))) {
29225 #if CYTHON_USE_PYLONG_INTERNALS
29226 const digit* digits = ((PyLongObject*)b)->ob_digit;
29227 const Py_ssize_t size = Py_SIZE(b);
29228 if (likely(__Pyx_sst_abs(size) <= 1)) {
29229 ival = likely(size) ? digits[0] : 0;
29230 if (size == -1) ival = -ival;
29235 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29236 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29240 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29241 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29245 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29246 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29250 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29251 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29255 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29256 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29260 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29261 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29267 return PyLong_AsSsize_t(b);
29269 x = PyNumber_Index(b);
29271 ival = PyInt_AsSsize_t(x);
29275 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29276 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
29277 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29278 #if PY_MAJOR_VERSION < 3
29279 }
else if (likely(PyInt_CheckExact(o))) {
29280 return PyInt_AS_LONG(o);
29285 x = PyNumber_Index(o);
29287 ival = PyInt_AsLong(x);
29292 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29293 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29295 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29296 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.